Skip to content

Instantly share code, notes, and snippets.

@bigntallmike
Created September 2, 2025 20:14
Show Gist options
  • Select an option

  • Save bigntallmike/f43eda5dbc4b93e74fa0bab988cdf844 to your computer and use it in GitHub Desktop.

Select an option

Save bigntallmike/f43eda5dbc4b93e74fa0bab988cdf844 to your computer and use it in GitHub Desktop.
Convert tinydns to hosts format
# Use this as you will, its imperfect, but generates a decent /etc/hosts file on stdout
with open("/var/lib/tinydns/root/data", "r") as tinydnsdata:
for line in tinydnsdata:
if line[:1] == "=":
hostname, ip = line[1:].split(":")
print(f"{ip.strip()}\t{hostname}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment