Linux not resolving linux hostnames but does resolve windows hostnames

1

I have a network of computers, mainly Windows machines on a windows domain.

I have 2 Linux machines, which are connected to the network and get their IP's via DHCP from the Windows 2003 server.

My windows machine (Win7-00), can ping all machines by their hostnames, including the Linux machines (N40L and Lin001).

My two Linux machines can ping my Windows machines by hostname (Win7-00) but cannot ping the other Linux machines by hostname. i.e. N40L cannot ping Lin001 and Lin001 cannot ping N40L. They CAN ping eachothers the IP's. And I have an nfs export working via IP at the moment (which I wish to use via hostname)

Is this the Linux PC's not sending hostnames to the DHCP or is there something I need to change on them to allow pinging of Linux hostnames?

I don't want to manually add the hostnames to /etc/hosts as they're dynamic IP's and one of the machines is a laptop which sometimes won't be on the domain network.

What should I do?

wkdmarty

Posted 2014-09-05T12:09:25.167

Reputation: 555

Are you running a DNS server on your network? Are all the hosts configured to use it? – lzam – 2014-09-05T12:27:23.277

Yes, the Windows 2003 server has one. – wkdmarty – 2014-09-05T12:39:08.200

Answers

0

I'm sorry, I think I've fixed it.

I have Avahi installed, and read that I needed port 5353 udp open. I opened them on iptables and now I can ping hostname.local

i.e.

On Lin001 I can ping n40l.local and on N40L I can ping lin001.local

Thanks for all your help.

wkdmarty

Posted 2014-09-05T12:09:25.167

Reputation: 555

0

Depends on what distro you're using but this is how i have it set up (on centOS)

on your localhost line in /etc/hosts add the "hostname.domain" e.g fred.jane.com

127.0.0.1 hostname.domain hostname localhost.localdomain localhost

then in /etc/sysconfig/network-scripts/ifcfg-eth# (# is the number of the interface useing DHCP)

DHCP_HOSTNAME=hostname

that works for me... also make sure you have setup windows DHCP to be able to auto update DNS

Fegnoid

Posted 2014-09-05T12:09:25.167

Reputation: 839

I am on Ubuntu based systems. I have send host-name gethostname(); in /etc/dhcp/dhclient.conf. – wkdmarty – 2014-09-05T12:43:15.650

instead of using gethostname(); have you tried just having send host-name "hostname" – Fegnoid – 2014-09-05T12:45:32.967

and shouldn't you be editing /etc/dhcp3/dhclient.conf? and not /etc/dhcp/dhclient.conf – Fegnoid – 2014-09-05T12:48:17.450

I only have /etc/dhcp/ – wkdmarty – 2014-09-05T12:59:44.503