Re: gethostbyaddr returning null for CNAME records
From: Villy Kruse (vek_at_station02.ohout.pharmapartners.nl)
Date: 02/27/04
- Next message: junky_fellow: "mmap vs read/write"
- Previous message: Andrei Voropaev: "Re: close and O_NONBLOCK on TCP/IP socket in Linux"
- In reply to: David Schwartz: "Re: gethostbyaddr returning null for CNAME records"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 27 Feb 2004 09:01:33 GMT
On Thu, 26 Feb 2004 15:19:33 -0800,
David Schwartz <davids@webmaster.com> wrote:
>
>
> Your expectation is wrong. The function is get*HOST*byaddr, not
> get*WhateverHappensToBeThere*byaddr. Since there is no host record, it
> correctly returns NULL.
>
> The gethostbyaddr function tries to resolve an IP address to a PTR
> record to obtain the host name. In this case, there is no host name. If you
> look in the 'hostent' structure that gethostbyaddr returns, there is no
> place to put 'the canonical name for the IP address'.
>
> Basically, a CNAME for an IP address is not a host name.
>
It may be if it is part of a rfc2317 style in-addr.arpa delegation. The
name to which the CNAME refers to must then resolve to a PTR RR for the
real hostname and the latter seems to be missing.
Villy
- Next message: junky_fellow: "mmap vs read/write"
- Previous message: Andrei Voropaev: "Re: close and O_NONBLOCK on TCP/IP socket in Linux"
- In reply to: David Schwartz: "Re: gethostbyaddr returning null for CNAME records"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|