Skip to content
This repository has been archived by the owner on Oct 3, 2020. It is now read-only.
/ local-cname Public archive

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

License

Notifications You must be signed in to change notification settings

hjacobs/local-cname

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages