Multiple domains pointed to the same IP

glen herrmannsfeldt gah at ugcs.caltech.edu
Thu Dec 9 19:25:02 UTC 1999


naplesweb at gulfcoast.net (Jeff Cochran) writes:

>>>I understand that there can only be one entry in the PTR file which gives
>>>one domain name for a given IP address when a reverse lookup is performed.
>>
>>>Does this mean you cannot have mutiple domains map to a single IP on the
>>>Internet e.g.:
>>
>>>one.mydomain.com    -> 192.1.2.3
>>>one.anotherdomain.com -> 192.1.2.3
>>
>>As far as I know, multiple PTR are legal, but usually not recommended.
>>
>>You can have multiple A or CNAME pointing to A for a name, but the PTR
>>only needs to point to one name.  Usually I find one preferred name.

>What about systems that check the reverse DNS to allow access, for FTP
>for example?  If I have two domains:

>foo.bar.com  192.1.2.3
>foo.bar.net  192.1.2.3

>but it would be the same 2.1.192.in-addr-arpa file with:

>192.1.2.3  foo.bar.com

>I would assume a reverse from foo.bar.net would go to foo.bar.com,
>correct?

When you ftp, the server gets the IP address, 192.1.2.3.  It then does
a gethostbyaddr(), to get the name from the PTR entry.  But since you
could have a fake name in the PTR entry, it is necessary to verify
that the name actually has that address.  To do this, it does a 
gethotsbyname() using the PTR name, and checks through the addresses
returned (there may be more than one) to see if any are the original address.
(Sun does this inside gethostbyaddr(), otherwise it might be done by ftp).

Now, if more than one name is returned by gethostbyaddr() should it look
up all the names?  And then check all the addresses for those names?
That seems unnecessary to me.  It is only necessary that one name have
an A entry for that address.

-- glen


More information about the bind-users mailing list