[Gllug] * on mail exchanger records

Tom Gilbert tom at linuxbrit.co.uk
Mon Jul 23 22:47:49 UTC 2001


* home at alexhudson.com (home at alexhudson.com) wrote:
> Let's say, for example, that they have foo.com on their name servers, and we
> have a machine which is in the domain foo.com. (This is where my knowledge
> of DNS falls down - please correct me in the following...) 
> 
> We want to look up bar.com, for example. Given we're in foo.com, we lookup
> bar.com.foo.com (we're looking up an A record - want to go to a webpage for
> example), and this doesn't return NXDOMAIN but NOERROR with no answers. We
> hunt on for bar.com - but this time, the lookup for bar.com fails with
> NXDOMAIN because it doesn't exist (in this hypothetical world, all the
> three-letter .com domains aren't all taken :). And Lynx is unable to view
> the document (except it goes through all the interations of bar.com.com etc,
> first, and probably bar.com.com.foo.com as well... :( ). An nslookup for
> bar.com returns bar.com.foo.com, but with no answer obviously, and this
> seems to confuse a number of programs.

Actually that's old school - DNS doesn't work that way anymore on any
relatively modern OS. If you are in domain foo.com and you look up
bar.com, it will look up "bar.com." first, then it will try in your
domain. There has to be at least two dots (including the last) for it to
look for it as a fully qualified domain name, if there isn't one it will
try the current domain first.

Just to test it:

Console A:
(gilbertt at fw:gilbertt)$ nslookup -sil bah.com
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   bah.com
Address: 156.80.1.10

Console B:
(root at fw:gilbertt)# tcpdump -i eth1 src or dst port 53
tcpdump: listening on eth1
23:37:32.435517 offended.co.uk.32780 > richelieu.ns.easynet.net.domain:  30553+ A? bah.com. (25) (DF) [tos 0x10] 
23:37:32.446326 offended.co.uk.32780 > richelieu.ns.easynet.net.domain:  46542+ PTR? 36.1.40.195.in-addr.arpa. (42) (DF) [tos 0x10] 
23:37:32.469588 richelieu.ns.easynet.net.domain > offended.co.uk.32780:  46542* 1/3/3 PTR[|domain]
23:37:32.554490 richelieu.ns.easynet.net.domain > offended.co.uk.32780:  30553* 1/2/2 A www.bah.com (119)
23:37:32.561134 offended.co.uk.32780 > richelieu.ns.easynet.net.domain:  29802+ PTR? 10.1.80.156.in-addr.arpa. (42) (DF) [tos 0x10] 
23:37:32.675559 richelieu.ns.easynet.net.domain > offended.co.uk.32780:  29802* 1/2/2 PTR[|domain]

Tom.
-- 
   .^.    .-------------------------------------------------------.
   /V\    | Tom Gilbert, London, England | http://linuxbrit.co.uk |
 /(   )\  | Open Source/UNIX consultant  | tom at linuxbrit.co.uk    |
  ^^-^^   `-------------------------------------------------------'

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list