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

Bug#686970: Inconsistent ipv6 handling of localhost in netbase and netcfg



Philipp Kern <pkern@debian.org> writes:
> On Tue, Sep 18, 2012 at 10:25:06AM +0200, Bjørn Mork wrote:
>> For example:
>> 
>>     bjorn@canardo:~$ grep localhost /etc/hosts
>>     127.0.0.1       localhost
>>     ::1     ip6-localhost ip6-loopback
>> 
>>     bjorn@canardo:~$ host localhost
>>     localhost has address 127.0.0.1
>>     localhost has IPv6 address ::1
>>     bjorn@canardo:~$ host ::1
>>     1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa domain name pointer localhost.
>> 
>> This is not good...  Which addresses will a service listening on
>> "localhost" listen too?  Seems it depends on whether DNS is available or
>> not.  Isn't that seriously buggy?
>
> Well, if you redefine localhost on your local DNS server, that's what
> you get…

Well, the debian bind9 package ships with zone "localhost" pointing to:

;
; BIND data file for local loopback interface
;
$TTL    604800
@       IN      SOA     localhost. root.localhost. (
                              2         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      localhost.
@       IN      A       127.0.0.1
@       IN      AAAA    ::1


So you should expect that...


> Is there an RfC that regulates localhost's definition?

There are plenty of them.  As usual that does not help as much as if
there had been ONE.   You may choose to use RFC 2606 strictly, saying
that the AAAA record above is wrong.

RFC 6303 (BCP 163) is rather explicit about *not* stating any default
name for 1.0.0.127.in-addr.arpa or
1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa

<quote>
   a meaningful reverse
   mapping should exist, but the exact setup is out of the scope of this
   document
</quote>


No, I didn't get any wiser. Except that I now am pretty convinced that
no service should listen to "localhost".  They should explictly choose
127.0.0.1 and/or ::1


Bjørn


Reply to: