tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: getaddrinfo(3) on numerical addresses



On Tue, Oct 24, 2017 at 10:57:42PM +0700, Robert Elz wrote:
>   | 3. syntactically correct numerical IPv4 addresses contain digits and dots
> 
> Which is exactly what a domain name can contain.   The only reason that
> IP addresses (in textual format) are not currently valid domain names, is
> that there are currently no top level domains with all numeric labels.
> But who knows what ICANN will create next week?

At least inet_pton parses a numerical IPv4 addresses without any dots.
Add the implicit search domain from /etc/resolv.conf and you can get
names for gai that contains purely digits and are still ambigious on
whether they should be resolved via DNS or not.

Joerg


Home | Main Index | Thread Index | Old Index