4 ms·
I agree with the article, but I would go even further. This whole thing is stupid. You physically can’t put an IP address into an MX DNS record. What the syn
by teddyh 6y ago
I agree with the article, but I would go even further. This whole thing is stupid. You physically can’t put an IP address into an MX DNS record. What the syntax (perhaps misleadingly) allows is to put a domain name there with labels consisting of only digits. That is, the “IP adress” 1.2.3.4 you wrote in your MX record is actually the domain name "1.2.3.4.yourdomain.com" with “1”, “2”, “3”, “4”, “yourdomain”, and “com” as the individual domain labels. There is no way to actually store an IP address in an MX DNS record. It just so happens that the usual syntax for IPv4 addresses turns out to be valid syntax for an (unrelated) domain name as well.
And, of course, if you try to write an IPv6 address, it will naturally fail, since IPv6 addresses uses colon “:” characters, which are not allowed in domain names.
Therefore, it would be beyond silly for programs to actually use these invalid domain names in MX records. MX records which point to domain names which cannot be resolved are simply broken.
- bombcar 6y agoAt some point someone’s going to get the .0 to .255 TLD somehow and cause a security fuffle.
- teddyh 6y agoAs luck would have it, that’s probably not going to affect most people, because people who write an “IP address” in an MX record probably also didn’t put the terminating period at the end. Therefore, the MX record to “1.2.3.4” resolves to the local name “1.2.3.4.example.com” and not a domain in the hypothetical “.4” TLD.
- bombcar 6y agoNow I wonder how many of these might have the ability for users to create subdomains ... shades of being able to make "webmaster@" addresses for email sites and get an SSL cert or whatever.
- TheCraiggers 6y agoSome software / sites put one there for you. Which is annoying when you don't want it.
- userbinator 6y agoAccording to RFC 1123: However, a valid host name can never have the dotted-decimal form #.#.#.#, since at least the highest-level component label will be alphabetic https://tools.ietf.org/html/rfc1123#page-13 https://tools.ietf.org/html/rfc1123#page-13
- Dylan16807 6y agoFinally, 359.33.9.234 can be real.
- 4cao 6y ago> 359.33.9.234 I searched to see where it's from (CSI: Miami) and found a screenshot of it in a gallery with even more egregious examples, like 67.259.2942.1003 and 8394.83.384.38482: https://www.root.cz/galerie/pocitacove-nesmysly-ve-filmech/#1 https://www.root.cz/galerie/pocitacove-nesmysly-ve-filmech/#...
- chungy 6y agoIt's a simple way to avoid numbers on-screen from coinciding with any real IP addresses. It's the equivalent to phone numbers always starting with 555.
- u801e 6y agoI'm not sure if this is still the case, but 555-1212 is the number for directory assistance.
- cardiffspaceman 6y agoNANP [1] has reserved other line numbers for other uses, including specifically entertainment [1] https://nationalnanpa.com/number_resource_info/555_numbers.html https://nationalnanpa.com/number_resource_info/555_numbers.h...
- kijin 6y agoIn an alternate timeline, using four 16-bit numbers instead of octets could very well have been a solution to the IPv4 shortage. :)
- DonHopkins 6y agoOr in the future, CHAOS-2 could use one 1024 bit decimal number, making IPV6 obsolete, and disrupting the page layout of HN threads! https://en.wikipedia.org/wiki/Chaosnet https://en.wikipedia.org/wiki/Chaosnet All hail the second coming of Chaosnet, the return of the Tzeentch Control Protocol! https://lovecraft.fandom.com/wiki/Chaos_God https://lovecraft.fandom.com/wiki/Chaos_God >Major Chaos Gods >Tzeentch: The Architect of Fate, who uses powerful sorceries to alter the future. He was once the greatest of the Chaos Gods and is potentially the most powerful. He's the God of Change, who endlessly plots and schemes, in a cosmic-wide game of subterfuge and manipulation. He became fully sentient in the 2nd millenium, due to mankind during Earth's medieval period. Tzeentch listens to the hopes of all mortals, feeding on their need and desire for change.
- lurgburg 6y ago> You physically can’t put an IP address into an MX DNS record Per TFA, > some mail servers do configure an IP address. Many mail servers are lenient when it comes to this misconfiguration and will deliver mails nevertheless I.E. people can and do put IP addresses into these things. And any actual example is a complete rebuttal of claims of impossibility. Standards don't have any cosmic significance. If people use a thing in a manner, then it's also that thing.
- xg15 6y agoI think the point here is that the "lenient" behaviour actually is a lot more complex than one would expect - a compliant mail server would need some special logic to detect hostnames that kinda look like IP addresses and handle them in a special way - without this behaviour being in any way standardized. E.g., the lenient server would have to treat the value "10.0.0.254" like an IP address but "10.0.0.256" like a hostname that requires DNS resolution.
- abiogenesis 6y agoThis is a solved problem and not very complicated. For starters the last DNS label of a hostname cannot be all numbers: https://tools.ietf.org/html/rfc1123#page-13 https://tools.ietf.org/html/rfc1123#page-13
- garaetjjte 6y agoBut name stored in MX doesn't have to be FQDN. I can set up A record with real server IP at 1.2.3.4.example.com, then set 1.2.3.4 in MX for example.com, and it would be perfectly standard compliant record, while it probably would be misinterpreted by servers trying to be "lenient".
- teddyh 6y ago> But name stored in MX doesn't have to be FQDN. On the contrary, an MX record can only contain a FQDN. If you type “foo” as your target in an MX record in your domain “yourdomain.example”, what actually gets stored in the MX record is “foo.yourdomain.example.”; a perfectly normal FQDN.
- xg15 6y agoOut of curiosity though: why is it like this? Wouldn't it make a lot more sense to set an IP address instead of a hostname? Now the admin needs to keep track of an additional DNS entry (for the mail server) and the client has to make one additional request.
- topranks 6y agoIt’s been the way since way back in the 80s. Domain name is often the best way to go. Esp if different organisations are involved (like a mail hostel.)
- freeone3000 6y agoOnly A and AAAA records take an IP. Everything else is a hostname. This simplifies administration, as there's only one hostname->IP config point, so you have the flexibility to resolve the rest dynamically.
- JdeBP 6y agoIt's a good question. It did not have to be designed this way, and indeed there have existed for some decades now DNS content server softwares that hide this indirection from administrators as a convenience, and synthesize the intermediate domain names if necessary. For example, the back-end database for tinydns has "@" records in its source data files, and an administrator can (optionally) just enter: @example.net:192.0.2.0::10 tinydns synthesizes "mx.example.net." for the intermediate domain name. * http://jdebp.uk./Softwares/djbwares/guide/commands/tinydns-data.xml http://jdebp.uk./Softwares/djbwares/guide/commands/tinydns-d... That said, the SMTP Relay server needs to know that "mx.example.net." is one of its names, if it is a fallback server. One can envision a world where records in the DNS database map a (domain,service,transport) tuple directly to a set of (address,port,preference,weight) tuples, where that is what administrators consistently deal with for everything, where that is how the on-the-wire protocol actually works, and where SMTP Relay loop prevention works by comparing IP addresses; but SMTP doesn't work like that, the DNS did not start out like that, the DNS has gone through at least two iterations to even get to where it is now with SRV and MX records, and the DNS has grown through fitting new mechanisms against existing ones. One point about "mx.example.net.": If the intermediate domain names are in-bailiwick like that, and the MX response contains "glue", then it is not actually "one additional request".
- pwdisswordfish6 6y agoWhat if I write 4.3.2.1.in-addr.arpa. instead?
- zrm 6y agoThat's a name, not an IP address. And what you would expect to find at that name is not an A record for that IP address (which would be redundant) but a PTR record providing its canonical name.
- derefr 6y ago“1.2.3.4.in-addr.arpa.” would work, no?