I've heard all sorts of reasons against using .local, .dev or .app. Is there a definitive standard for this?<p>What TLD do you use for local development? or do you just forgo the domain all together and use your local IP?
I use ".test" to respect RFC-6761 [1] which reserves four TLDs: .example, .invalid, .localhost, and .test; as many of us already know ".dev" is owned by Google [2] and both ".local" [3] and ".app" [4] are reserved for the root zone so it doesn't makes any sense to use any of them for local development. So I use ".test" for my personal projects and ".[company]" for projects related with my job.<p>[1] <a href="https://tools.ietf.org/html/rfc6761" rel="nofollow">https://tools.ietf.org/html/rfc6761</a><p>[2] <a href="https://icannwiki.com/.dev" rel="nofollow">https://icannwiki.com/.dev</a><p>[3] <a href="https://tools.ietf.org/html/rfc6762" rel="nofollow">https://tools.ietf.org/html/rfc6762</a><p>[4] <a href="https://icannwiki.com/.app" rel="nofollow">https://icannwiki.com/.app</a>
I use a subdomain of a domain I own, such as internal.example.com<p>I can then run a BIND instance with internal.example.com as a root, then map all my services to their own domain if need be.<p>This is a little overkill for a one man shop, but it's a nice little home development setup.<p>The one thing you need to configure, if you want it to work out of the box is that your DHCP server needs to send back the IP address of your local BIND service for DNS, else it won't work right and you'll need to manually configure it every time.<p>An example of where this worked well for me was when I was using one nginx instance to run snapshots of all my clients websites. With nginx, you can set up "virtual hosts" which map a hostname to a configuration block. You could also just edit your /etc/hosts file to accomplish the same thing I guess.
I use .dev of course! I realize that .test is the sensible choice, but there's some odd WordPress/Serialization benefit to keeping the TLD length the same.<p>Google bought it up, and I've never seen it in the wild, so it works well for me.
I edit my host file and use .dev for specific domains, if you configure a web server to said domains it'll route you to the right folder as well (edit: Virtual Host). Though I typically use Vagrant or VirtualBox to test my environments off a 'remote' server.
I remember a tile back in early the 2000s when we had a quite nice setup of local dns servers that had internal only zonefiles that resolved names like service.company.local to the internal/dev versions of service.company.com.<p>Worked quite nicely until the Mac users upgraded to a version of OS X which included Bonjour...<p>There days Mac OS X does a pretty nice job here all on it's own - this machine I'm typing on here happily answers as Iain.local to the internal network... (For some not-worth-my-time-to-debug reason, our Netgear NAS is a whole lot less reliable with it's Bonjour/zeroconf .local name...)
You can modify your /etc/hosts to point to localhost and that does the trick without having to go through a TLD or care if the domain is taken.<p>Contents of /etc/hosts:<p>127.0.0.1 domain.com<p>127.0.0.1 subdomain1.domain.com<p>127.0.0.1 subdomain2.domain.com
I personally use ".vm"<p>I run a vagrant box on my Windows machine - so ".vm" describes what I do very well.<p>And unless a new country is formed, there will never be new 2 letter TLDs.
I use a subdomain and run it in the form of dev.<myactualdomain>.com . I add a record to my /etc/hosts file to redirect it to 127.0.0.1. This also means for https stuff I have a valid certificate to use as well. One more note. I almost never run anything on any port other than port 80/443. Any application I work on generally has nginx sitting in front of it with a simple proxy_pass rule.
I still use .dev for the majority of sites, I'm pretty pissed that Google was allowed to appropriate it! It has so far bitten me on the ass once when a CDN was involved (the CDN resolved it to Googles servers so the failure wasn't detected - causing numerous invisible problems).<p>I think I will probably go along the route of assigning a domain to my local network
I have historically used .local despite its use with the Multicast DNS Standard. I have not encountered any technical issues with its use.<p>If my devices were on a network accessible from the outside world, I would have used my ghostfreeman.net domain and submasked all of those projects. However, these resources can't leave the network.
I use .docker because I use dinghy for all my development (<a href="https://github.com/codekitchen/dinghy#dns" rel="nofollow">https://github.com/codekitchen/dinghy#dns</a>)
Since no one has mentioned this one yet, I use '.loc' throught /etc/hosts<p>Each dev on the team use the same .loc domains but the IP may be different depending on the IP the Docker interface is assigned.
One trick is to use non-routable (e.g. 192.168.0.0/16) IP addresses with DNS records for subdomains of your company's domain name, e.g. devserver123.mycompany.com routes to 192.168.100.123
lvh.me for non-public addresses where I want to test subdomains<p>ngrok.io when it needs to be public<p>(yeah, I know those aren't TLDs, but I rarely use any when developing TBH)