Friday, April 10, 2015

Making my Ubuntu box resolvable by hostname on my network

I had an old PC laying around with some old flavor of Ubuntu.  I decided to resurrect it to use as a backup server, ssh server, or whatever the heck else I wanted (it is Linux, after all ;)

Anyway... I connected it to my router and fired it up.  I saw "voyager" pop up on the Network display of my router, so I was pretty happy.  I ssh'ed in and started updating to the latest release - 14.04.

All went well, until the next time I tried to ssh or vnc to my box...  "Could not resolve hostname."  What?!?!  This worked a little while ago...  What changed?  My router still called it voyager...  Oh well, I just started using the IP instead.

Finally, I determined to figure this out.  After some googling, I found that I need to add this line to /etc/dhcp/dhclient.conf:
send host-name "voyager";
It was originally:
send host-name = gethostname();
 But that didn't work anymore for some reason.  Restart network:
sudo service network-manager restart
And we were in business!

No comments: