[Dnsmasq-discuss] hosts resolving to public addresses not private

Chris Green cl at isbd.net
Fri Feb 17 18:46:47 GMT 2012


On Fri, Feb 17, 2012 at 11:38:57AM -0500, Brent S. Elmer Ph.D. wrote:
> On Fri, 2012-02-17 at 15:59 +0000, Chris Green wrote:
> 
> > > 
> > > What I would like to do is set up dnsmasq to resolve local/private hosts
> > > to local/private addresses not public addresses.
> > > 
> > Well surely dnsmasq only comes into it when someone asks it something.
> > 
> > What you're seeing, I *think* is the address returned by the *router*
> > for the given name.
> > 
> > Certainly I get the LAN/internal IP addresses for all my networked
> > computers behind a NAT router like yours.  However all my computers are
> > set up to get both DHCP and DNS services from a single machine running
> > dnsmasq. Most (but not quite all) linux and windows systems will
> > correctly provide their name to the DHCP server when obtaining an IP
> > address.
> > 
> 
> That makes sense that computer 1 would not know anything about computer
> 2 or 3 other than through the router.
> 
> Computer 2 is set up use dnsmasq running on itself as the dns server
> even though it gets its ip address for eth0 via the router.

What's in its /etc/hosts and /etc/resolv.conf files?         


>                                                              dmsmasq on
> computer 2 also hands out the dhcp address for wlan0 to computer 3.  So
> it appears that dnsmasq running on computer 2 does not know about its
> own ip address for eth0 since dnsmasq dhcp did not give out the address
> the router did.  Is there a way to have dnsmasq on computer 2 to know
> about its own DHCP given ip address associated with its own hostname?
> Maybe by associating the NIC card address to the hostname or something?
> 
I have a couple of entries added to my /etc/dnsmasq.conf to do exactly
this:- 

    dhcp-host=00:90:a9:70:06:ff,backup
    dhcp-host=40:61:86:98:f2:41,chris

> Shouldn't computer 2 know the local ip address of computer 3 since
> dnsmasq is running on computer 2 for dns lookup and also hands out the
> DHCP ip address to computer 3?
> 
One would think so, again what do /etc/hosts and /etc/resolv.conf files
look like on computer 3?

-- 
Chris Green



More information about the Dnsmasq-discuss mailing list