Skip to main content

Helper script to emulate a local CNAME DNS by writing to /etc/hosts

Project description

Latest Version Development Status Python Versions License

This is a little helper script to emulate a local CNAME DNS by writing to /etc/hosts. DNS changes (e.g. to rollout new services) can be tested by overwriting DNS names in the local /etc/hosts file. The hosts file only supports IP addresses thus making it cumbersome to emulate a DNS CNAME without a local DNS server/proxy. The local-cname is a very small script to automatically lookup DNS names and write IP addresses to the hosts file. It is self-contained and restores your local /etc/hosts file on exit (press CTRL+C).


$ sudo pip install -U local-cname


$ sudo local-cname FROM_DNS_NAME TO_DNS_NAME
  # press CTRL+C to cancel and restore your old /etc/hosts


$ sudo local-cname
$ ping

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for local-cname, version 0.3
Filename, size File type Python version Upload date Hashes
Filename, size local_cname-0.3-py3-none-any.whl (4.7 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size local-cname-0.3.tar.gz (2.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page