Ask HN: What TLD do you use for local development?
I've heard all sorts of reasons against using .local, .dev or .app. Is there a definitive standard for this?
What TLD do you use for local development? or do you just forgo the domain all together and use your local IP?
63 comments
[ 2.9 ms ] story [ 128 ms ] threadAnd if the IP of the development system happens to be publicly routed, attackers might reach and infiltrate a probably insecure development system.
Worked quite nicely until the Mac users upgraded to a version of OS X which included Bonjour...
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...)
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.
This is a little overkill for a one man shop, but it's a nice little home development setup.
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.
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.
[1] https://tools.ietf.org/html/rfc6761
[2] https://icannwiki.com/.dev
[3] https://tools.ietf.org/html/rfc6762
[4] https://icannwiki.com/.app
Don't assume what doesn't exist now won't exist in the future. ;)
If you mean "correct" as in the production domain, then you're introducing a security risk for no reason. Never use a public (or potentially public) domain for testing or development.
I run a vagrant box on my Windows machine - so ".vm" describes what I do very well.
And unless a new country is formed, there will never be new 2 letter TLDs.
The last was in 2010, adding BQ.
[1] https://cr.yp.to/djbdns/dot-local.html
2) Integration with development tools like http://pow.cx/ or https://github.com/puma/puma-dev allow you to automatically startup and shutdown apps. This is useful when you're juggling multiple apps.
3) Security. Using a standard domain/port for local development opens you up to exploits like http://benmmurphy.github.io/blog/2016/07/11/rails-webconsole...
https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_con...
ngrok.io when it needs to be public
(yeah, I know those aren't TLDs, but I rarely use any when developing TBH)
This looks interesting, but how would one ever find out about this?
Google bought it up, and I've never seen it in the wild, so it works well for me.
And as WordPress work makes up a big portion of my paycheck I understand the serialization but haven't worried about it since moving to WP CLI everywhere and adding it to project scripts/automation.
It'll handle serialization and you can even use it for quick import/export:Contents of /etc/hosts:
127.0.0.1 domain.com
127.0.0.1 subdomain1.domain.com
127.0.0.1 subdomain2.domain.com
Or just "localhost" if it's a personal project with no domain
I think I will probably go along the route of assigning a domain to my local network
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.