Re: [SLUG] hostname resolution wackiness

From: Paul M Foster (paulf@quillandmouse.com)
Date: Sat Jul 10 2004 - 18:31:03 EDT


On Fri, Jul 09, 2004 at 11:18:52PM -0400, Chad Perrin wrote:

> I'm still figuring out all this 'nix networking stuff. In fact, I mostly
> operate on the PFM principle ("pure f'ing magic") where networking with
> 'nix is
> concerned. I install Debian Sarge, install Samba, and fiddle with smb.conf
> until it does what I want it to on my hybrid network.
>
> My issue is this: I can't ping by hostname.
>
> There are three Debian machines on this network now (one Woody Stable,
> two Sarge
> Testing). With all three of these, I cannot ping most of the network by
> hostname. I cannot SSH by hostname, either. I can, however, ping by IP
> address, can nmblookup by hostname, and can ping the router (which also
> provides
> DHCP) by hostname. The Windows boxen on the network ping each other and the
> Linux machines by IP address or hostname without problems.

Forget the fact that your Windows machines can talk to each other.
Doesn't have anything to do with it. They're using Windows crap to
figure out each other.

Your Linux boxen can't talk to each other because they can't equate the
hostname you're giving them with the IP they have to have to find each
other. The fact that you can ping by IP means the network infrastructure
is working.

There are several ways to allow machines to resolve names. First is to
assign fixed IPs to machines in each machine's /etc/hosts file. For each
machine on the network, the /etc/hosts file will host the names, aliases
and IPs of all the other machines on the network. Someone else explained
this elsewhere on this thread. But this won't work if you're assigning
IPs via DHCP.

The other way to do this is with an internal DNS server. Equating IPs
with hostnames is exactly what the DNS does, both on the internet and
internally on your network.

The problem is that you're dynamically assigning IPs via DHCP. I'm told
that some DNS servers can compensate for this DHCP practice, but I don't
know how to do it, nor do I know which DNS servers will do it.

A better idea might be this: When each machine comes up, it can be
configured to have a specific IP address and hostname. This is done on
Debian via the /etc/network/interfaces file (I can send you a sample
one). Make sure that each machine configures itself for a different IP
address. Note that these are _fixed_ IPs. Now set up a DNS server that
knows all these IP-hostname translations.

Bottom line is that if you insist on dynamic IPs on your LAN, you're
going to have a difficult time getting your machines to recognize each
other by hostname. It will be easier to make the IPs fixed.

Paul
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 20:22:40 EDT