[Dnsmasq-discuss] dnsmasq w/Upstream DHCP

richardvoigt at gmail.com richardvoigt at gmail.com
Thu Nov 4 21:55:42 GMT 2010


You might try the dhclient-script man page, here
http://linux.die.net/man/8/dhclient-script

What you want is for dhclient to put its DNS servers where dnsmasq can
find them, not where the system resolver will use them.
/etc/resolv.conf should only list 127.0.0.1, dnsmasq will forward to
the other servers as needed.  To make this happen it sounds like
redefining make_resolv_conf will be necessary, along with dnsmasq's
resolv-file option to make dnsmasq read the file created by dhclient.

On Thu, Nov 4, 2010 at 4:46 PM, Michael Convey <smconvey at gmail.com> wrote:
> Richard,
>
> I am working through Red Hat technical support and the CentOS forums (among
> other things). However, finding answers has been slow and challenging. I am
> hoping someone on this mailing list will have some useful insights to help
> me resolve my issues.
>
> Michael
>
>
>
> On Thu, Nov 4, 2010 at 2:17 PM, richardvoigt at gmail.com
> <richardvoigt at gmail.com> wrote:
>>
>> These are all questions about when RedHat consults dnsmasq, not what
>> dnsmasq does.  It's not dnsmasq's job to "force nslookup to" anything.
>>
>> You should consult resources on configuring RHEL for solutions to
>> these problems (for one thing, the solution is the same whether you're
>> running ISC Bind, dnsmasq, some other DNS service, or want to use a
>> different non-local DNS server than the one listed in your upstream
>> DHCP).
>>
>> On Thu, Nov 4, 2010 at 3:21 PM, Michael Convey <smconvey at gmail.com> wrote:
>> > I'm using dnsmasq for small virtual network (one RHEL 5.5 machine acting
>> > as
>> > a Xen host - hostname: server.exampe.com - with two Xen guests). IP
>> > addresses of the virtual network are statically assigned and maintained
>> > in
>> > the /etc/host files. My /etc/hosts file reads as follows:
>> >
>> > # Do not remove the following line, or various programs
>> > # that require network functionality will fail.
>> > 127.0.0.1               localhost.localdomain localhost
>> > ::1                     localhost6.localdomain6 localhost6
>> > 192.168.122.1   server.example.com      server
>> > 192.168.122.2   centos.example.com      centos
>> > 192.168.122.3   fedora.example.com      fedora
>> >
>> > I'm not using dnsmask's DHCP functions. However, my machine is part of
>> > an
>> > external network that uses DHCP (Windows). Even with dnsmasq on,
>> > nslookup
>> > showed my system was favoring the upstream DNS servers. So, I did the
>> > following:
>> >
>> > 1) in /etc/sysconfig/network-scripts/ifcfg-eth0, I added the line
>> > "DNS1=127.0.0.1"
>> > 2) in /etc/dnsmasq.conf, I uncommented the line "strict-order"
>> > 3) in /etc/dhclient-eth0, I added the following line: supersede
>> > domain-search "";
>> >
>> > After a network restart, my resolv.conf file read as follows:
>> >
>> > ; generated by /sbin/dhclient-script
>> > nameserver 127.0.0.1
>> > nameserver 10.10.15.10      #upstream DNS server via DHCP
>> > nameserver 10.125.110.44       #upstream DNS server via DHCP
>> >
>> > Sometimes the resolv.conf spontaneously changes back to all upstream
>> > nameservers (drops the 127.0.0.1). If I do a network restart it comes
>> > back.
>> > How is the "DNS1=127.0.0.1" in /etc/sysconfig/network-scripts/ifcfg-eth0
>> > overridded? Could this be related to upstream DHCP lease renewal?
>> >
>> > Also, even when the resolv.conf file reads as above, 'nslookup
>> > server.example.com' or 'nslookup 192.168.122.1' gives the following:
>> >
>> > # nslookup 192.168.122.1
>> > Server:         10.10.15.10
>> > Address:        10.10.15.10#53
>> >
>> > ** server can't find 1.122.168.192.in-addr.arpa.: NXDOMAIN
>> >
>> > # nslookup server.example.com
>> > Server:         10.10.15.10
>> > Address:        10.10.15.10#53
>> >
>> > ** server can't find server.example.com: NXDOMAIN
>> >
>> > Why doesn't dnsmaq force nslookup to first check /etc/hosts?
>> >
>> > _______________________________________________
>> > Dnsmasq-discuss mailing list
>> > Dnsmasq-discuss at lists.thekelleys.org.uk
>> > http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>> >
>> >
>
>



More information about the Dnsmasq-discuss mailing list