Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 10-18-2009, 09:50 AM   #1
LQ Newbie
Registered: Nov 2007
Posts: 8

Rep: Reputation: 0
Question Internal Hostname Lookup


I manage a small network in my home with a combination of windows and linux hosts. For a while I have simply accessed other pc's using their ip address as linux does not automatically resolve the internal host names with my router. I'm wanting to change this.

I was thinking the way to go about it would be to set up a custom dhcp and dns server on my server to do this, however I would like it not to be static, i.e. when a new host registers with the dhcp server, its hostname is automatically added to the dns entry, and then removed again when the dhcp entry expires (or updated the next time the same hostname reconnects).

Does anyone know how to do this? Or any decent howto's online? Can you recommend anything else instead? I have spent a while trying to find this information but all I can find is how to set up a dhcp server with no name resolution, or a dns server with static name resolution.

Thanks in advance,

Old 10-18-2009, 03:15 PM   #2
Registered: Sep 2009
Location: Phoenix, AZ
Distribution: Gentoo, Debian, Ubuntu
Posts: 121

Rep: Reputation: 27
Just an idea, I don't know if it will work though. If you are running an open source router firmware, and perhaps even with a closed source firmware that allows telnet, you may be able to run a cron script to pull the current dhcp table from the router on a regular basis. Parse this information and add it into your /etc/hosts file for your machine. Make sure the script can identify your static hosts and your dynamic hosts (those pulled from the cron script.)

Hope this gives you a lead.


dhcp, dns

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hostname lookup failure chandrait2004 Linux - Newbie 3 06-23-2011 04:23 PM
how to lookup a hostname of a networked computer otkaz Linux - Newbie 4 06-17-2009 11:21 AM
Lookup hostname from IP address Geneset Linux - Networking 5 08-26-2008 06:03 AM
unable to lookup my hostname via gethostbyname() function fakie_flip Linux - Software 4 09-03-2006 04:52 AM
Odd hostname lookup problem max_sipos Linux - Networking 3 11-15-2004 12:29 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:46 AM.

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