I just completed a fresh install of Centos 7 on a PC. It is connected to the campus network, so I am not in control of the DNS server. I gave it a hostname by setting the HOSTNAME value in /etc/sysconfig/network. I also set the DHCP_HOSTNAME value in /etc/sysconfig/network-scripts/ifcfg-eth0 and rebooted the system.

The problem is I cannot ping this machine from another arbitrary computer. I keep getting messages saying that the host doesn't exist.

What are some typical ways that a machine on DHCP gets its hostname tied to its ip address so that it will resolve? Is there a way to send the DHCP server my hostname?

  • 2
    Your hostname as set by you is local to the computer. Some DHCP/DNS combinations can update DNS automatically, but others can't - it all depends on the infrastructure. Speak to your DNS administrators :-) Mar 12, 2016 at 10:10

1 Answer 1


Im Guessing you are talking about a local-net (private) DNS Server, not one that is reachable from the internet.

If you set the Hostname only on your machine, the other PC's in the network are not aware of that. if you just want to try eg. a Webserver on your PC, you can put in the other machines in the /etc/hosts file a temporary record for your PC. If you want that all the other PC's are reaching yours with the DNS name. You have to contact the Admin of the DNS server. In some situations where there is a Active Directory you can announce your DNS name if you join the AD.

Don't Update your hostfile anymore. You can use the nip.io Service for this use case. Let's say for example your Webserver is reachable under the IP Address then you can access it using the following DNS Name
If the ip was then use the hostname and so on.

This is especially useful if you want to have virtual hosts, but this is very well explained if you go to the homepage: nip.io Homepage.

  • 1
    This is a good answer if you don't have access to update campus DNS servers. Plan B is you can publish your IP address. Also there are several dynamic DNS resolvers out there than you can configure provided your campus firewalls let you get to them. dyndns.org is one example. Oct 3, 2018 at 6:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .