Helper script to emulate a local CNAME DNS by writing to /etc/hosts https://pypi.org/project/local-cname/
 
Go to file
Henning Jacobs 65e1f3f47c update Python versions 2020-10-03 15:21:38 +02:00
local_cname Merge pull request #3 from Neki/prevent_concurrent_executions 2020-10-03 15:17:43 +02:00
.gitignore initial hack 2017-04-05 12:13:53 +02:00
LICENSE initial hack 2017-04-05 12:13:53 +02:00
README.rst non-sudo pip install 2019-04-13 14:53:28 +02:00
requirements.txt Add requirements 2020-06-15 21:58:12 +01:00
setup.py update Python versions 2020-10-03 15:21:38 +02:00

README.rst

Local CNAME

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).

Installation:

$ pip install -U local-cname  # might need "sudo" or use "--user"

Usage:

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

Example:

$ sudo local-cname google.com duckduckgo.com
$ ping google.com