I'm using dnsmasq for small virtual network (one RHEL 5.5 machine acting as a Xen
host - hostname: <a href="http://server.exampe.com">server.exampe.com</a> - 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:<br><br># Do not remove the following line, or various programs<br># that require network functionality will fail.<br>127.0.0.1 localhost.localdomain localhost<br>
::1 localhost6.localdomain6 localhost6<br>192.168.122.1 <a href="http://server.example.com">server.example.com</a> server<br>192.168.122.2 <a href="http://centos.example.com">centos.example.com</a> centos<br>
192.168.122.3 <a href="http://fedora.example.com">fedora.example.com</a> fedora<br><br>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:<br><br>1) in /etc/sysconfig/network-scripts/ifcfg-eth0, I added the line "DNS1=127.0.0.1"<br>2) in /etc/dnsmasq.conf, I uncommented the line "strict-order"<br>3) in /etc/dhclient-eth0, I added the following line: supersede domain-search "";<br>
<br>After a network restart, my resolv.conf file read as follows:<br><div class="xoopsCode"><code></code><br>; generated by /sbin/dhclient-script<br>nameserver 127.0.0.1<br>nameserver 10.10.15.10 #upstream DNS server via DHCP<br>
nameserver 10.125.110.44 #upstream DNS server via DHCP<br><br></div>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?<br><br>Also, even when the resolv.conf file reads as above, 'nslookup <a href="http://server.example.com">server.example.com</a>' or 'nslookup 192.168.122.1' gives the following:<br>
<br># nslookup 192.168.122.1<br>Server: 10.10.15.10<br>Address: 10.10.15.10#53<br><br>** server can't find 1.122.168.192.in-addr.arpa.: NXDOMAIN<br><br># nslookup <a href="http://server.example.com">server.example.com</a><br>
Server: 10.10.15.10<br>Address: 10.10.15.10#53<br><br>** server can't find <a href="http://server.example.com">server.example.com</a>: NXDOMAIN<br><br>Why doesn't dnsmaq force nslookup to first check /etc/hosts?<br>