*BSD News Article 47782


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!news.kei.com!news.mathworks.com!uunet!in2.uu.net!news1.digital.com!pa.dec.com!nntpd.lkg.dec.com!usenet
From: Jon Jenkins <jenkinsj@ozy.dec.com>
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: BIND, DNS and route broken ??
Date: 2 Aug 1995 01:26:34 GMT
Organization: Digital Equipment Corp
Lines: 155
Message-ID: <3vmk8a$pgr@nntpd.lkg.dec.com>
NNTP-Posting-Host: ozyd13-p3.ozy.dec.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 1.1N (X11; I; BSD/386 uname failed)
X-URL: news:comp.unix.bsd.freebsd.misc#3vjnu5$7jo@agate.berkeley.edu

I have a slip connection to work. When I dial in 
I dont know what port I will be given so I have
to wait for the response from the server to set
up the routes etc.

To cut a long story short I enter a route to the
local IP address to use the localhost i.e. lo0.
I noticed that this took an extraordinary amount
of time so I ran tcpdump to find out what was taking
so long. Surprise when route tried to get the 
address of the localserver it was using the bind
server. Not only that it was using incorrect syntax
to the bindserver. Ok Ill fix you I said so I
changed the host.conf file to use the hosts file
first. No go! the resolver ALWAYS uses bind first
no matter what order they are in the host.conf
file. I could be wrong but I thought that the 
order in the host.conf file determined the search
order. Well it don't.

Ok now to the more serious problem: inocorrect
use of the namserver.

In my script to start the slip link I have the 
following line:

route add -host ozyd13-pX localhost

wher x is the port on the server.
This adds my local interface to the lo0
loopback driver so I can ping myself 
and send output to myself. This is important
for some X apps which have default displays
not on the local host and require either
the DISPLAY var to be set to ozyd13-pX
or to have the command line override 
-display ozyd13-pX. In either case unless
there is a route to yourself they wont
work.

Ok so what should happen is that the
route command should see that this 
is a name address and send a bind
query to the nameserver. Ok so what happens ?
Well it correctly extends the unqulaified
name to its full domain but instead of sending
an A? to get the IP address of a name
it sends a PTR? query to get the name
of an address and passes the fully qualified
name as an address!!

here is the commented trace, please excuse the long lines
I could be interpreting these the wrong way. Ihave
used Stevens book as a reference but I might be wrong.

#ok we extend the name ok but then ask for a name for this name ??
01:00:20.212631 O ip 83: ozyd13-p3.ozy.dec.com.1571 > oils.ozy.dec.com.domain:1+ PTR?
ozyd13-p3.ozy.dec.com. (39) (ttl 64, id 4091)

#what did we expect expect but failure
01:00:20.406309 I ip 83: oils.ozy.dec.com.domain > ozyd13-p3.ozy.dec.com.1571: 1* 0/0/0 (39) (ttl 29, id
10491)

#try cutting the domain 
01:00:20.406874 O ip 79: ozyd13-p3.ozy.dec.com.1572 > oils.ozy.dec.com.domain: 2+ PTR? ozyd13-p3.dec.com.
(35) (ttl 64, id 4092)

#of course theres no domain
01:00:26.222409 I ip 140: oils.ozy.dec.com.domain > ozyd13-p3.ozy.dec.com.1572: 2 NXDomain* 0/1/0 (96)
(ttl 29, id 11082)

#this has gone away now but we got the message so why send this
01:00:26.222550 O ip 72: ozyd13-p3.ozy.dec.com > oils.ozy.dec.com: icmp: ozyd13-p3.ozy.dec.com udp port
1572 unreachable (ttl 255, id 4094)

#try again with cut domain
01:00:30.400287 O ip 79: ozyd13-p3.ozy.dec.com.1574 > oils.ozy.dec.com.domain: 2+ PTR? ozyd13-p3.dec.com.
(35) (ttl 64, id 4095)

# and of course ther is still no domain
01:00:33.346909 I ip 140: oils.ozy.dec.com.domain > ozyd13-p3.ozy.dec.com.1574: 2 NXDomain* 0/1/0 (96)
(ttl 29, id 11792)

#ok cut even further
01:00:33.347458 O ip 71: ozyd13-p3.ozy.dec.com.1575 > oils.ozy.dec.com.domain: 3+ PTR? ozyd13-p3. (27)
(ttl 64, id 4096)


#which fails as expected
01:00:40.844749 I ip 132: flotsm.ozy.dec.com.domain > ozyd13-p3.ozy.dec.com.1576: 3 NXDomain* 0/1/0 (88)
(ttl 29, id 28546)

#oh finally we decide to try the correct query
01:00:40.846386 O ip 83: ozyd13-p3.ozy.dec.com.1577 > oils.ozy.dec.com.domain: 4+ A?
ozyd13-p3.ozy.dec.com. (39) (ttl 64, id 4099)

#success as expected
01:00:41.049640 I ip 99: oils.ozy.dec.com.domain > ozyd13-p3.ozy.dec.com.1577: 4* 1/0/0 A
ozyd13-p3.ozy.dec.com (55) (ttl 29, id 12619)

#oh no we are not going to do the same for localhost are we? oh yes we are
01:00:41.050357 O ip 83: ozyd13-p3.ozy.dec.com.1578 > oils.ozy.dec.com.domain: 5+ PTR?
localhost.ozy.dec.com. (39) (ttl 64, id 4100)

#what does this mean: no domain
01:00:41.298686 I ip 146: oils.ozy.dec.com.domain > ozyd13-p3.ozy.dec.com.1578: 5 NXDomain* 0/1/0 (102)
(ttl 29, id 12645)

#so well cut it and try again
01:00:41.299269 O ip 79: ozyd13-p3.ozy.dec.com.1579 > oils.ozy.dec.com.domain: 6+ PTR? localhost.dec.com.
(35) (ttl 64, id 4101)

#and fail
01:00:43.618962 I ip 79: oils.ozy.dec.com.domain > ozyd13-p3.ozy.dec.com.1579: 6* 0/0/0 (35) (ttl 29, id
12881)

#and again
01:00:43.619494 O ip 71: ozyd13-p3.ozy.dec.com.1580 > oils.ozy.dec.com.domain: 7+ PTR? localhost. (27)
(ttl 64, id 4102)

#and fail
01:00:48.400137 I ip 132: oils.ozy.dec.com.domain > ozyd13-p3.ozy.dec.com.1580: 7 NXDomain* 0/1/0 (88)
(ttl 29, id 13414)

#phew we got there at last
01:00:48.401319 O ip 83: ozyd13-p3.ozy.dec.com.1581 > oils.ozy.dec.com.domain: 8+ A?
localhost.ozy.dec.com. (39) (ttl 64, id 4103)

#or did we, no domain because is specified as just localhost in /etc/hosts on server !!
01:00:48.645413 I ip 146: oils.ozy.dec.com.domain > ozyd13-p3.ozy.dec.com.1581: 8 NXDomain* 0/1/0 (102)
(ttl 29, id 13448)

#cut it and try again
01:00:48.645919 O ip 79: ozyd13-p3.ozy.dec.com.1582 > oils.ozy.dec.com.domain: 9+ A? localhost.dec.com.
(35) (ttl 64, id 4104)

#ok this is a localhost, dont undertand why this worked but what the hell 
01:00:48.954356 I ip 268: oils.ozy.dec.com.domain > ozyd13-p3.ozy.dec.com.1582: 9 1/6/6 A localhost (224)
(frag 13476:232@0+) (ttl 29)

Anyone got any ideas why this happens with route. The host functionality
works fine with the trace as expected. 

Jon


-- 
----------------------------------------------------------------------
Name:      Dr Jon Jenkins    Location: Digital Equipment Corporation NaC
Voice/Fax: 61-7-55-75-0151/100         Burnett Place, Research Park,  
Inet:      jenkinsj@ozy.dec.com        Bond University, Gold Coast
Close Proximity: "HEY YOU !!!"         QLD, AUSTRALIA 4229
"Daddy, what's outside the Universe?" (My 5 year old.....)
-----------------------------------------------------------------------