The best way to safely and securely use local domains pointing to 127.0.0.1 is to edit your local settings (/etc/hosts) and add your own settings. Keep in mind if you want to use subdomains, you need to enter all variations.
Example:
# Adding bottom of your current file /etc/hosts
################# MY LOCAL DOMAINS
127.0.0.1 local.com admin.local.com
127.0.0.1 domain1.com
127.0.0.1 api.domain1.com
I HAVE NO RESPONSIBILITY FOR ANY DOMAINS LISTED HERE, OR IN THE COMMENTS, AND IF ANY OF THEM CAPTURE ANY DATA TRANSMITTED BY THE HTTP REQUEST. AT ANY TIME, ANY OF THE DOMAINS LISTED IN THIS ARTICLE MAY STOP WORKING (EXCEPT localhost).
It turns out that some kind hearted people already set up wildcard domains for you already. You can use any domain below and/or any subdomain of these and they currently resolve to 127.0.0.1 but could switch at any time to resolve somewhere else. Here's the list of ones I know about. Let me know if there are more!
localhost
- It will always works. Do you know why? <--- Now there's no sorry.[*.]fbi.com
- ๐ ๐ ๐ ๐ ๐ - check it[*.]localtest.me
- check it[*.]yoogle.com
- check it[*.]lacolhost.com
- check it[*.]local.sisteminha.com
- check it[*.]cefgo.com
- check itdomaincontrol.com
- check it- See below comments for more domains
Of course, you can setup your own local domain.
- Read Renatofrota's comment below.
sources:
http://www.fidian.com/programming/public-dns-pointing-to-localhost(Page not found. Read Fidian's comment to understand why)- http://blog.reenhanced.com/post/29566591244/developing-with-subdomains-just-got-a-lot-easier
- https://stackoverflow.com/questions/1562954/public-wildcard-domain-name-to-resolve-to-127-0-0-1
- https://markinns.com/archive/how-to-setup-a-local-dns-host-file-on-mac-os-x.html
Also the last paragraph uses the url dsnchecker.com, so dsn instead of dns and .com instead of .org ;)