Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a home Home Router (DD-WRT) and I want to be able to look up machines via hostname. However, I would like to do this with machines where the IP Address id dynamically given via DHCP. Example hosts names from my network:

Machine                    Hostname IP address   Method
----------------------     -------- ----------   -----------
Router                             192.168.1.1
File Server                abcd    192.168.1.2   (Static)
HTPC                       htpc    192.168.1.x   (Dynamic)
Windows Gaming Machine     bear    192.168.1.x   (Dynamic)

I have 1 machines which have static IP addresses, and I am able to connect to this machine via the hostname because I have configured the hostname in the DNSMasq section of my DD-WRT

DD-WRT Panel -> Services Tab -> Services Sub tab -> DNSMasq section

address=/abcd/192.168.1.123

I want to be able to access HTPC via the htpc hostname from within my network, but i don't want to put it in the DNSMasq configuration section because it's not always gauranteed the same IP address. Is there a setting to tell DD-WRT to dynamically configure DNSMasq for hosts who don't have static IP's (instead have DHCP)??

Thanks

share|improve this question

1 Answer 1

In DD-WRT, you can configure DHCP to give a particular host (given a specific MAC address) a static hostname and IP address. This is called static DHCP lease.

If you take this approach, you'll get some of the benefits of both: your HTPC IP/hostname is managed by DHCP, but you'll always know what it is. dnsmasq in DD-WRT will also make use of this information so you can look up the machine by hostname.

Here are instructions on how to set this up:

Also, to avoid conflicts with other DHCP clients, you should change DHCP server's IP range to control which IP addresses are usable for dynamic use. In your case...

Machine                    Hostname IP address   Method
----------------------     -------- ----------   -----------
Router                             192.168.1.1
File Server                abcd    192.168.1.2   (Static)
HTPC                       htpc    192.168.1.5   (Static DHCP assignment)
Windows Gaming Machine     bear    192.168.1.nn  (Dynamic DHCP assignment)

... you want DHCP to only issue IPs where nn is some value greater than 5.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.