DNSMasq Local Network

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 23:19, 27 August 2006 (edit)
Squisher (Talk | contribs)
m (2) Additional DNS Options)
← Previous diff
Revision as of 02:32, 29 August 2006 (edit) (undo)
AlReece45 (Talk | contribs)

Next diff →
Line 1: Line 1:
So far I've learned of 3 ways to configure the DD-WRT, so that it will perform DNS for your local network. I don't claim to know which way is preferred by the developer(s) of the DD-WRT. So far I've learned of 3 ways to configure the DD-WRT, so that it will perform DNS for your local network. I don't claim to know which way is preferred by the developer(s) of the DD-WRT.
-== 1) Editting the /etc/hosts file ==+== 1) Editing the /etc/hosts file ==
This is probably the first place one attempts getting this to work if you have a *NIX background. And it does work here with a '''''**caveat**''''' , once you've editted your /etc/hosts, you need to restart/reload DNSMasq. So for example if you populate your /etc/hosts with the startup_rc script like: This is probably the first place one attempts getting this to work if you have a *NIX background. And it does work here with a '''''**caveat**''''' , once you've editted your /etc/hosts, you need to restart/reload DNSMasq. So for example if you populate your /etc/hosts with the startup_rc script like:
Line 29: Line 29:
== 2) Additional DNS Options == == 2) Additional DNS Options ==
-Administration->Services->DNSMasq+Administration > Management
-(or at least in v23 SP1 Final (05/16/06) it's located in Administration->Management)+ 
 +'''NOTE:''' Before v23 SP1 Final it was Administration->Services->DNSMasq
You can enter DNS info about machines in this format: You can enter DNS info about machines in this format:

Revision as of 02:32, 29 August 2006

So far I've learned of 3 ways to configure the DD-WRT, so that it will perform DNS for your local network. I don't claim to know which way is preferred by the developer(s) of the DD-WRT.

1) Editing the /etc/hosts file

This is probably the first place one attempts getting this to work if you have a *NIX background. And it does work here with a **caveat** , once you've editted your /etc/hosts, you need to restart/reload DNSMasq. So for example if you populate your /etc/hosts with the startup_rc script like:

'echo 192.168.1.50    somename' >> /etc/hosts

from the startup script. You also need to put:

killall dnsmasq 
dnsmasq --conf-file /tmp/dnsmasq.conf 

in your startup script. So your script ends up looking like:

'echo 192.168.1.50    somename' >> /etc/hosts

killall dnsmasq 
dnsmasq --conf-file /tmp/dnsmasq.conf 

Lastly, if you want the router to append your domain on DNS request, put "expand-hosts" into the DNSMasq other options

2) Additional DNS Options

Administration > Management

NOTE: Before v23 SP1 Final it was Administration->Services->DNSMasq

You can enter DNS info about machines in this format:

address=/machine_name/ip_address

For example:

address=/zinc/192.168.1.30/

Or fully qualified:

address=/zinc.your_domain.com/192.168.1.30/

Then things I don't like about this way are:

1) You can't have two (or more) names for the same machine in the same entry like in /etc/hosts. So instead you are forced to do:

address=/zinc.your_domain.com/192.168.1.30/
address=/zinc/192.168.1.30/
address=/zn/192.168.1.30/

2) I haven't been able to figure out how to have it append the domain name, so you end up needing both the short name and the fully qualified name (like above)

-comment- for v23, the trailing slash, as seen in the examples, caused it not to work. As soon as it was removed, the errors seen when re-starting dnsmasq (in ssh) went away and the service started resolving hostnames

3) Creating static leases

Static leases from Administration->Services->DHCP Server

You just hit "add", and type them in. You need to "save" settings at the bottom of the page (Duh). The thing I don't like about this method is:

1) If you do NOT want to tie MAC addresses with IPs then you have to use a fake MAC address on this form, because the info doesn't save without a MAC address

2) If you need to enter many of these, it get tedious