James Harton | 9 Oct 22:35
Favicon

gethostbyname() & gethostbyaddr()

Hi there.

Other than using Protocols.DNS.Query is there a way to look up IPv6  
pointers and quad-A records?

 > gethostbyname("www.kame.net");
(7) Result: ({ /* 3 elements */
               "www.kame.net",
               ({ /* 1 element */
                   "203.178.141.194"
               }),
               ({ })
           })
 > gethostbyaddr("2001:200:0:8002:203:47ff:fea5:3085");
gethostbyaddr(): IP-address must be of the form a.b.c.d

Thanks,

James.

gethostbyname() & gethostbyaddr()

No. The gethostbyaddr() and gethostbyname() methods in Pike are only
aware of IPv4 adresses at this point.

I guess they could be extended to understand the IPv6 as well, but at
least for gethostbyname() we would need to add a type argument so it
would be possible to only get IPv4/6 adresses, defaulting to only IPv4
for compatibility. (Getting IPv6 adresses from the resolver still
confuses way too many systems!)


Gmane