Skip to content

Instantly share code, notes, and snippets.

@yuhonas
Last active December 13, 2018 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuhonas/b6235f35c0d55c66b1baca51b0207d8e to your computer and use it in GitHub Desktop.
Save yuhonas/b6235f35c0d55c66b1baca51b0207d8e to your computer and use it in GitHub Desktop.
Which TLD should you be using for development and how to use it

Using the right TLD & Tools for Development & Testing

First of all, what TLD’s should you use for development

At the time of writing the list of Reserved TLDs contains 4 different domains specifically for "Testing & Documentation Examples"

  • .test
  • .example
  • .invalid
  • .localhost

A subsection of the document also declares reserved second-level addresses:

  • example.com
  • example.net
  • example.org

See [Reserved Top Level DNS Names)(http://tools.ietf.org/html/rfc2606) for more info

Right, but how would I use one of those locally

macOS

The crudest way is to make an entry in your /etc/hosts/ file, fortunately there are tools which can streamline this such as SwitchHosts

Another option is to install a local DNS server such as http://www.thekelleys.org.uk/dnsmasq/doc.html to re-route for example all *.test requests to localhost See also Using Dnsmasq For Local Development On MacOS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment