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

Strange problem with local name resolution



Hi everybody,

after installing some brand new Sarge systems I've been facing a strange 
problem concerning the resolution of local(!) hostnames.

It's a very common situation:

I've got two fresh sarge boxes connected to the internet as usual. Say, 
the have the IPs 123.456.789.123 and 123.456.789.456.

Additional, the servers are connected to each other over a second 
network interface with local addresses 192.168.0.100 and 192.168.0.101.

In the /etc/hosts files (on each machine) there are the following 
entries:

**************************************************
127.0.0.1	localhost

192.168.0.100	box1.mylocalnetwork.loc	box1
192.168.0.101	box2.mylocalnetwork.loc	box2

123.456.789.123	www.somename.net	www
123.456.789.456	data.somename.net	data
**************************************************

Well, and here's the problem. Being logged-in on box2, the command:

`host 192.168.0.100`

results in: "Host 192.168.0.100 not found: 3(NXDOMAIN)"

and also

`host box1.mylocalnetwork.loc`

results in: "Host box1.mylocalnetwork.loc not found: 3(NXDOMAIN)"

The STRANGE thing (I belive it's dark magic) is that the name resolution 
works fine for apt-get (ftp). I have a local debian mirror on box1, and 
my /etc/apt/sources.list (on box2) has the name (not the IPs!) of 
box1.mylocalnetwork.loc as debian ftp source. And it works! But it 
doesn't for mysql (slave tries to connect for replication - this 
fails).

Some additional information about what I've done to solve the problem:

- Checked /etc/resolv.conf
	search mylocalnetwork.loc somename.net
	nameserver xxx.xxx.xxx.xxx
(of course it's a valid nameserver IP)

- Checked /etc/nsswitch.conf
	hosts:          files dns
	networks:       files

- Checked /etc/hosts
	(see above)

- Did `strace -vf -o /tmp/straceout getent hosts box1`. Result:
	"192.168.0.100	box1.mylocalnet.loc	box1"

- Checked network configuration, ok.

Note: there is NO problem connection to the machines by IP addresses. 
There is NO problem resolving arbitrary hostnames in the public world 
(e.g. www.yahoo.com).

What's going on there?

Thanks in advance for any hint.

Best regards,
Andreas

-- 
procommerz - Internet fuer Unternehmen
www.procommerz.de | 033925-90710

Öffentlicher GnuPG-Schlüssel  / public GnuPG key:
http://www.procommerz.de/standort/avent_pub_key.gpg



Reply to: