LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 12-07-2011, 08:39 AM   #1
int0x80
Member
 
Registered: Sep 2002
Location: Cincinnati
Distribution: Debian GNU/Linux
Posts: 310

Rep: Reputation: 31
Question Hostname does not persist on LAN


I recently moved my home server OS to Debian from Ubuntu. The hardware is the same, so during the install, it was offered the previous hostname, which I accepted. Internally, DNS and DHCP are served up by dnsmasq from dd-wrt running on my WRT54G. None of the settings have changed on the WRT54G, but now the server cannot be reached by name.

LAN domain: meta.verse
Hostname: blacksun

Code:
blacksun:~ $ sudo uname -n
blacksun
blacksun:~ $ sudo hostname -a
blacksun
blacksun:~ $ sudo hostname -s
blacksun
blacksun:~ $ sudo hostname -d
meta.verse
blacksun:~ $ sudo hostname -f
blacksun.meta.verse
blacksun:~ $ sudo hostname --fqdn
blacksun.meta.verse
blacksun:~ $ cat /etc/hostname 
blacksun
I can reach the box just fine via its IP address, but if contact is attempted via the hostname, then nothing happens:

Code:
reason:~$ ping blacksun.meta.verse
ping: unknown host blacksun.meta.verse
There are no firewall rules, everything is ACCEPT, and the box knows its own hostname. I did try changing the hostname on the server, but still could not reach it without using the IP address. Not sure what the cause could be.
 
Old 12-07-2011, 08:51 AM   #2
rodrifra
Member
 
Registered: Mar 2007
Location: Spain
Distribution: Ubuntu
Posts: 199

Rep: Reputation: 36
Either you have an entry in your /etc/hosts with the IP for blacksun.meta.verse or your DNS knows how to resolve it. Otherwise, you will get the unknown host error.

So the solution is either edit your hosts file or configure your DNS (if you are the owner).

Last edited by rodrifra; 12-07-2011 at 09:00 AM.
 
Old 12-07-2011, 09:08 AM   #3
int0x80
Member
 
Registered: Sep 2002
Location: Cincinnati
Distribution: Debian GNU/Linux
Posts: 310

Original Poster
Rep: Reputation: 31
Yup, DNS is served by dnsmasq on the WRT54G. All other hosts on the network resolve fine, just not this one. The /etc/hosts file looks alright to me:

Code:
blacksun:~ $ head /etc/hosts
127.0.0.1       localhost
127.0.1.1       blacksun.meta.verse     blacksun
Comparatively on one of the hosts:

Code:
reason:~$ head /etc/hosts
127.0.0.1       localhost
127.0.1.1       reason
I tried removing the 'blacksun.meta.verse' column from /etc/hosts on blacksun, but that didn't solve the problem.
 
Old 12-07-2011, 09:41 AM   #4
int0x80
Member
 
Registered: Sep 2002
Location: Cincinnati
Distribution: Debian GNU/Linux
Posts: 310

Original Poster
Rep: Reputation: 31
Angry

Well I rebooted the WRT54G and now it works alright. Worst solution ever.
 
  


Reply

Tags
debian, dnsmasq, hostname, ip address


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access to hostname on LAN and WAN Zilvermeeuw Linux - Networking 11 08-01-2011 11:16 PM
why I cannot ping my machines in my LAN with hostname? davidshen84 Linux - Newbie 6 02-25-2009 10:40 AM
Getting the hostname from a Linux computer on a LAN CJS Linux - Networking 4 07-09-2008 08:36 PM
Is it enough to set the IP Address and Hostname in a LAN? sgware Linux - Networking 2 11-15-2007 01:15 AM
Ping a computer in LAN using hostname seven Linux - Networking 3 07-05-2003 10:42 PM


All times are GMT -5. The time now is 02:20 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration