4 ms·
The following TLDs are fine and reserved: .test .example .invalid .localhost RFC2606 (https://da
by baobun 3y ago
The following TLDs are fine and reserved:
.test
.example
.invalid
.localhost
RFC2606 (https://datatracker.ietf.org/doc/html/rfc2606 https://datatracker.ietf.org/doc/html/rfc2606)
- deng 3y agoYes, but who would want .test, .example or .invalid as an internal domain? Also, they are too long (yes, that matters). What I've seen lately is '.int' for internal usage. While this is a valid TLD, it is only for international organizations, and it is not possible for "normal" people to reserve a domain with that TLD, so unless your company is called "WHO" or similar, you shouldn't have any problems...
- ocdtrekkie 3y agoPeople thought .dev was safe until it wasn't. Bear in mind they can still do something like "enroll all of .int in HSTS preload" (like was done for .dev), and suddenly your browsers will permanently refuse to load any of your internal sites.
- yrro 3y agoNo one competent would ever have thought dev. was safe. It's quite simple: if you don't own the domain, or it hasn't been reserved (e.g., home.arpa.), don't use it!
- patmorgan23 3y ago.Corp exist and is reserved for private use.
- deleted 3y ago[deleted]
- codetrotter 3y agoTest is best used in temporary setups that you use for testing things. Example is best used in documentation only. Invalid is weird and confusing. Localhost as a TLD should still be on the machine itself. Keeping in mind that 127.0.0.1 is not the only loopback address at your disposal – you have the whole /8. You could bind different services on different loopback ip addresses and then assign host names in the .localhost tld to those. So for example you could run different Wordpress instances locally on your machine on ips 127.87.80.2, 127.87.80.3, and 127.87.80.4, so that each can run on port 80 without colliding with one another, and without resorting to having non-80/non-443 ports. Then have corresponding entries in /etc/hosts 127.87.80.2 dogblog.localhost 127.87.80.3 cooking.localhost 127.87.80.4 travel.localhost And use those domains to access each of those from your browser. Then you don’t even need to keep all services behind the same Nginx instance for example, as you otherwise would do if you had different domain names but was using 127.0.0.1 and port 80 for all of them. Whereas having the localhost tld refer to hosts elsewhere on a physical network.. that’s about equally as weird and confusing as “invalid”.
- pwdisswordfishc 3y ago> Keeping in mind that 127.0.0.1 is not the only loopback address at your disposal – you have the whole /8. Tell that to Google Chrome developers, who are so arrogant they think they know better than the operating system, and force-resolve *.localhost. to 127.0.0.1
- loloquwowndueo 3y agoThen use a non-brain dead browser :)
- yrro 3y agoLooks like someone might have been trying to prepare the ground for a hijack of 127.0.0.0/8...
- bluejekyll 3y ago‘The ".localhost" TLD has traditionally been statically defined in host DNS implementations as having an A record pointing to the loop back IP address and is reserved for such use. Any other use would conflict with widely deployed code which assumes this use.’ Reading that sentence implies a single loop back address. I appreciate that IPv6 “fixed” this confusion by having a single loop back address of ::1. While you are correct that IPv4 reserved the entire /8 in practice the expectation is generally that 127.0.0.1 is the loopback address, and using other addresses in the 127/8 space tends to lead to unexpected issues across many pieces of software. The intention of the .localhost domain is to ensure that DNS resolutions never resolves to something external, for security reasons. See also, RFC 5735: “… This is ordinarily implemented using only 127.0.0.1/32 for loopback.” — https://datatracker.ietf.org/doc/html/rfc5735 https://datatracker.ietf.org/doc/html/rfc5735
- CranberryDefuse 3y agoThey are reserved for Testing, & Documentation Examples. You should not used them in production.
- layer8 3y agoThe only one of those appropriate for accessing actual hosts would be .test, and obviously using .test for non-testing purposes would also not be appropriate.
- patmorgan23 3y ago.domain, .lan, .home, .host, and .Corp Are all options as well.