resolv.conf, bind9 and unresolvable local address

This is a discussion on resolv.conf, bind9 and unresolvable local address within the Linux Networking forums, part of the Linux Forums category; I have a machine in intranet (hostname phoenix.local, ip=10.1.1.214) with bind9 here and it has ...


Go Back   Usenet Forums > Linux Forums > Linux Networking

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-25-2008
peter pilsl
 
Posts: n/a
Default resolv.conf, bind9 and unresolvable local address



I have a machine in intranet (hostname phoenix.local, ip=10.1.1.214)
with bind9 here and it has a zone for a domain called "local" (and the
proper reverse-zone), which holds names only valid in the intranet like
"imap.local", "smtp.local" ... and "server.local" that points to the
machine itself (10.1.1.214)

my resolv.conf holds nameserver 127.0.0.1 and no search- or
domain-parameters.

and now troubles begins, cause on the server itself I can only ping the
local hostnames when *not* using the FQDN like "imap.local" but only
when using the first name like "imap"

#ping imap.local
ping: unknown host imap.local

*but:*

# dig +short imap.local
10.1.1.214

# dig +short @127.0.0.1 imap.local
10.1.1.214

*and:*

# ping imap
PING imap.local (10.1.1.214) 56(84) bytes of data.
64 bytes from phoenix.local (10.1.1.214): icmp_seq=1 ttl=64 time=0.018 ms
64 bytes from phoenix.local (10.1.1.214): icmp_seq=2 ttl=64 time=0.026
ms

why the hell does my local system not know its own full names !!!?????

the only thing that works is pinging the hostname as FQDN

#ping phoenix.local is fine !!


any help appreatiated (and all configs below)

thnx,
peter


# cat /etc/resolv.conf
nameserver 127.0.0.1

# cat named.conf
<skip>
zone "local" {
type master;
file "/etc/bind/db.local";
};

zone "1.1.10.in-addr.arpa" {
type master;
file "/etc/bind/db.10.1.1.rev";
};
<skip>

# cat db.local
$TTL 604800
@ IN SOA localhost. root.localhost. (
4 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
NS ns1.local.
MX 5 server.local.
;
server IN A 10.1.1.214
phoenix IN A 10.1.1.214
ns1 IN A 10.1.1.214
ns2 IN A 10.1.1.214
imap IN A 10.1.1.214
smtp IN A 10.1.1.214


# cat db.10.1.1.rev
$TTL 604800
@ IN SOA localhost. root.localhost. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
NS localhost.
;

214 PTR phoenix.local.


















Reply With Quote
  #2 (permalink)  
Old 03-25-2008
Burkhard Ott
 
Posts: n/a
Default Re: resolv.conf, bind9 and unresolvable local address

Am Tue, 25 Mar 2008 11:31:49 +0100 schrieb peter pilsl:

add domain to /etc/resolv.conf

> server IN A 10.1.1.214
> phoenix IN A 10.1.1.214


u should use CNAME for the other names
e.g. abc IN CNAME server

cya
Reply With Quote
  #3 (permalink)  
Old 03-25-2008
peter pilsl
 
Posts: n/a
Default Re: resolv.conf, bind9 and unresolvable local address

Burkhard Ott wrote:
> Am Tue, 25 Mar 2008 11:31:49 +0100 schrieb peter pilsl:
>
> add domain to /etc/resolv.conf
>
>> server IN A 10.1.1.214
>> phoenix IN A 10.1.1.214

>
> u should use CNAME for the other names
> e.g. abc IN CNAME server
>


thnx and your are right. I changed the zone-file but it did not solve my
original problem.

$TTL 604800
@ IN SOA localhost. root.localhost. (
6 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
NS ns1.local.
MX 5 server.local.
;
phoenix IN A 10.1.1.214
server IN CNAME phoenix.local.
ns1 IN CNAME phoenix.local.
ns2 IN CNAME phoenix.local.
imap IN CNAME phoenix.local.
smtp IN CNAME phoenix.local.



thnx
peter
Reply With Quote
  #4 (permalink)  
Old 03-25-2008
Burkhard Ott
 
Posts: n/a
Default Re: resolv.conf, bind9 and unresolvable local address

Am Tue, 25 Mar 2008 12:29:25 +0100 schrieb peter pilsl:


> thnx and your are right. I changed the zone-file but it did not solve my
> original problem.


Try the following:

host $NAME_from_your_zone $IP_of_your_DNS

Do you get a correct answer, if so use tcpdump and check that you get the
right DNS.

cya
Reply With Quote
  #5 (permalink)  
Old 03-26-2008
peter pilsl
 
Posts: n/a
Default Re: resolv.conf, bind9 and unresolvable local address

Burkhard Ott wrote:
> Am Tue, 25 Mar 2008 12:29:25 +0100 schrieb peter pilsl:
>
>
>> thnx and your are right. I changed the zone-file but it did not solve my
>> original problem.

>
> Try the following:
>
> host $NAME_from_your_zone $IP_of_your_DNS
>
> Do you get a correct answer, if so use tcpdump and check that you get the
> right DNS.
>



thxn for your answer. I tried what you recommended and to make it short:
I didnt get any new information. host-command gives correct answers,
but when doing a "ping imap.local" my DNS or another DNS isnt even
queried (tcpdump on lo and eth0) !!

here my outputs. I would be very happy if you could look over them to
see if I missed something. thnx.



host gives me the correct answer in any settings:

# host imap.local
imap.local is an alias for phoenix.local.
phoenix.local has address 10.1.1.214

# host imap.local 127.0.0.1
Using domain server:
Name: 127.0.0.1
Address: 127.0.0.1#53
Aliases:
imap.local is an alias for phoenix.local.
phoenix.local has address 10.1.1.214

# host imap.local 10.1.1.214
Using domain server:
Name: 10.1.1.214
Address: 10.1.1.214#53
Aliases:
imap.local is an alias for phoenix.local.
phoenix.local has address 10.1.1.214


if running

#tcpdump -i lo port 53

I see the queries:

12:03:31.412303 IP localhost.33026 > localhost.domain: 22783+ A?
imap.local. (28)
12:03:31.412682 IP localhost.domain > localhost.33026: 22783* 2/1/0
CNAME phoenix.local., (84)
12:03:31.413606 IP localhost.33027 > localhost.domain: 54842+ AAAA?
phoenix.local. (31)
12:03:31.413810 IP localhost.domain > localhost.33027: 54842* 0/1/0 (81)
12:03:31.413976 IP localhost.33028 > localhost.domain: 48801+ MX?
phoenix.local. (31)
12:03:31.414089 IP localhost.domain > localhost.33028: 48801* 0/1/0 (81)


when I run

#ping imap

I see my server querying for imap.local !!!

12:04:07.251898 IP phoenix.local.33028 > phoenix.local.domain: 24422+ A?
imap.local. (28)
12:04:07.252240 IP phoenix.local.domain > phoenix.local.33028: 24422*
2/1/0 CNAME phoenix.local., (84)
12:04:07.252579 IP phoenix.local.33028 > phoenix.local.domain: 52112+
PTR? 214.1.1.10.in-addr.arpa. (41)
12:04:07.252754 IP phoenix.local.domain > phoenix.local.33028: 52112*
1/1/1 PTR[|domain]
12:04:08.257814 IP phoenix.local.33028 > phoenix.local.domain: 10046+
PTR? 214.1.1.10.in-addr.arpa. (41)
12:04:08.258095 IP phoenix.local.domain > phoenix.local.33028: 10046*
1/1/1 PTR[|domain]

and when I run

#ping imap.local

no traffic at all on lo nor on eth0 - not on port 53 and not on any
other port !!!


I just dont get this !! This is kind of weird !! and starts to drive my
crazy !!

thnx,
peter



Reply With Quote
  #6 (permalink)  
Old 03-26-2008
Burkhard Ott
 
Posts: n/a
Default Re: resolv.conf, bind9 and unresolvable local address

Am Wed, 26 Mar 2008 11:10:43 +0100 schrieb peter pilsl:

>
> #ping imap
>
> I see my server querying for imap.local !!!
>
> and when I run
>
> #ping imap.local
>
> no traffic at all on lo nor on eth0 - not on port 53 and not on any
> other port !!!
>
>
> I just dont get this !! This is kind of weird !! and starts to drive my
> crazy !!



I copied your files into my bind, it works.
Please check the following files:
/etc/resolv.conf:
domain local <-- optional
search local
nameserver $DNS_IP

/etc/hosts:
If you have here an entry for imap.local you will not have DNS traffic at
all.

/etc/nsswitch.conf:
[...]
hosts: files dns <- it say watch first to /etc/hosts then DNS
networks: files
[...]

cya
Reply With Quote
  #7 (permalink)  
Old 03-27-2008
peter pilsl
 
Posts: n/a
Default Re: resolv.conf, bind9 and unresolvable local address

Burkhard Ott wrote:
>
> /etc/nsswitch.conf:
> [...]
> hosts: files dns <- it say watch first to /etc/hosts then DNS
> networks: files
> [...]
>



PROBLEM SOLVED !!!!!

my hosts-entry in nsswitch.conf was different. It looked like:

hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4


and then my brain finally cut in again. mdns4 is some mysterious
namecaching-stuff related to apples zeroconf-protocoll that came to my
server (ubuntu 7.10) with something like avahi-daemon. I could not
remove in on the fly (cause ubuntu-desktop-package is depending on this
little unwanted and unneeded daemon), so I simply changed my
nsswitch.conf to

hosts: files dns

as you recommended and as it should be and ... voila ... everything is
working as it should.

There are serveral reports on internet about extremely slow networks
with avahi-daemon and ready a line like mdns4_minimal [NOTFOUND=return]
might give us an idea, why :)

https://bugs.launchpad.net/ubuntu/+s...ahi/+bug/94940

I want to thank you a lot for helping me out here and for your effort
and patience to help me. I never thought at nsswitch.conf and while I
scanned my system for usual dns-caching-tools I never thought of this
avahi-stuff.

thnx a lot !!

peter
Reply With Quote
  #8 (permalink)  
Old 03-29-2008
Burkhard Ott
 
Posts: n/a
Default Re: resolv.conf, bind9 and unresolvable local address

Am Thu, 27 Mar 2008 12:44:46 +0100 schrieb peter pilsl:

> PROBLEM SOLVED !!!!!


> I want to thank you a lot for helping me out here and for your effort
> and patience to help me. I never thought at nsswitch.conf and while I
> scanned my system for usual dns-caching-tools I never thought of this
> avahi-stuff.
>
> thnx a lot !!
>
> peter


No problem, sometimes it needs a little before i have time to read and
answer but I'm happy for you either.

cya
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:16 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0