‘I can ping my servers via the FQDN. but not via the short hostname. Example: I can ping ,machine02.domain_name.net, but I can't pimg machine02.’ I am running Centos 7.

July 18, 2016 204 views

I have DSN A type entries for machine.domain_name.net.

1 Answer
MDS July 19, 2016
Accepted Answer

Add the following line to your hosts file /etc/hosts machine02.domain_name.net machine02.domain_name.net

And in your /etc/hostname file, change the hostname to


You also need to have an A record for machine02.domain_name.net pointing to the server IP address.

  • Thanks for the reply. That helped a ton and I change my /etc/hosts as follows (on machine 2): localhost machine02.daverieck.net machine01.daverieck.net machine01 machine02.daverieck.net machine02

    (on machine 1) localhost machine01.daverieck.net machine01.daverieck.net machine01 machine02.daverieck.net machine02

    They now can each ping each other via <ping machine0x)

    I am new to this and am not sure if this is the best way if you have hundreds of servers talking to each other, I am setting this up to allow Puppet to manage agents. Machine 1 will be the master and machine 2 will be the slave. As I add more slave servers, does anyone know if this is the best solution or is there another way via DNS management ?

Have another answer? Share your knowledge.