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?

  • Are you running a DNS server on your network? Are all the hosts configured to use it? – lzam Sep 5 '14 at 12:27
  • Yes, the Windows 2003 server has one. – wkdmarty Sep 5 '14 at 12:39
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

  • I am on Ubuntu based systems. I have send host-name gethostname(); in /etc/dhcp/dhclient.conf. – wkdmarty Sep 5 '14 at 12:43
  • instead of using gethostname(); have you tried just having send host-name "hostname" – Fegnoid Sep 5 '14 at 12:45
  • and shouldn't you be editing /etc/dhcp3/dhclient.conf? and not /etc/dhcp/dhclient.conf – Fegnoid Sep 5 '14 at 12:48
  • I only have /etc/dhcp/ – wkdmarty Sep 5 '14 at 12:59
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.