Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
dnsmasq, local name resolution on the router itself?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
neocui
Apprentice
Apprentice


Joined: 21 Apr 2003
Posts: 186

PostPosted: Thu Dec 14, 2006 9:27 am    Post subject: dnsmasq, local name resolution on the router itself? Reply with quote

dnsmasq has this amazing ability to resolve names for machines on the local lan. For example, if host foo makes a dns request to dnsmask, then dnsmask will resolve foo to the assigned address for the rest of the LAN. It works everywhere except on the server itself. Is there a workaround for this?
Back to top
View user's profile Send private message
neocui
Apprentice
Apprentice


Joined: 21 Apr 2003
Posts: 186

PostPosted: Thu Dec 14, 2006 9:48 am    Post subject: Reply with quote

read the dnsmasq doc. This is not possible, since dnsmasq gets the upstream servers from /etc/resolv.conf and it itself isn't in there.
The only way around this is to put 127.0.0.1 into /etc/resolv.conf and manually give dnsmasq the upstream server addresses, which is really inconvenient for PPP users.

So the another solution is to assign a static address to machine foo and put it in the /etc/hosts on the router. Add dhcp-host=foo to dnsmasq options to assign the static IP to that machine. This way, on the router machine, /etc/hosts is used instead to resolve that name, and dnsmasq passes it on to the rest of the network. The only downside is, the address has to be static.

It seems this all can be fixed by having dnsmasq automatically append entries to /etc/hosts for every dynamic address it assigns.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Thu Dec 14, 2006 10:17 am    Post subject: Reply with quote

Or you can install resolvconf-gentoo (dnsmasq has a use flag for it)
Then configure /etc/dnsmasq.conf as per the instructions in /etc/resolvconf/update.d/dnsmasq
Finally, configure the dns server on net.lo

dns_servers_lo=( "127.0.0.1" ) in /etc/conf.d/net

restart net.lo, net.ppp0 and then dnsmasq and voila - you're good to go :)
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum