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

Installation:

$ sudo pip install -U local-cname

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

Project details


Download files

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

Source Distribution

local-cname-0.3.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

local_cname-0.3-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file local-cname-0.3.tar.gz.

File metadata

  • Download URL: local-cname-0.3.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for local-cname-0.3.tar.gz
Algorithm Hash digest
SHA256 0789088fe2c911efbe1eee111cb8d3d9a6688721527a283f53f419cbee83542b
MD5 a527f6ec1c586d16beaca4dccdbd32b4
BLAKE2b-256 12fd6b95df27018d3356368fc93a1bf9ee494e144adac39a5429740e9d5dbd2e

See more details on using hashes here.

Provenance

File details

Details for the file local_cname-0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for local_cname-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c74b11dc1d8dace355297e0842e0206e1b8bdee1fb2675173176958a563769c4
MD5 af4ffd7186b223b368034fa95d8a804b
BLAKE2b-256 7e41b75cfea5f98dadafc3237dc9040cd57fa2239289424cf2bb94102fe78aad

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page