dig & nslookup can't resolve local hosts unless I specify the (local) DNS server to use
dig
(domain information groper) and nslookup
(query Internet name servers interactively) are tools that query name servers. Unless a specific name server is specified as a commandline argument they will query the name server(s) found in /etc/resolv.conf. They simply don't look at alternative sources of host information such as the /etc/hosts
file or other sources specified in /etc/nsswitch.conf
.
If you want to force all dns queries through dnsmasq on your sun host, the /etc/resolv.conf
there should point to dnsmasq, i.e. it should look like:
#/etc/resolv.conf on sun
nameserver 127.0.0.1
To prevent that file from getting overwritten when you restart the network interface eth0 edit /etc/sysconfig/network-scripts/ifcfg-eth0
and add the option PEERDNS=no
Second in /etc/dnsmasq-resolv.conf
you're trying to configure dnsmasq to use itself as the upstream name server nameserver 127.0.0.1
... That file should look like:
#/etc/dnsmasq-resolv.conf
search beowulf.iecs biol.uregina.ca
nameserver 8.8.8.8
if you want to use Google's name server. It might be a good idea to use the University name servers 142.3.102.202 & 142.3.100.15 there instead as it is not uncommon to have certain resources only visible from the campus network.
If your mercury host is configured by DHCP it should get it's configuration from dnsmasq and the /etc/resolv.conf
there points to the dnsmasq name server on 192.168.42.1
The 142.3.102.202 and 142.3.100.15 do not know anything about your local private network so they correctly return NXDOMAIN. These are also the default name servers for the system so when you don't specify a name server they will be used.
You will need to overwrite the contents of /etc/resolv.conf
and configure the nameserver directives to point to your local dnsmasq name server which in turn should be configured to forward queries it cannot answer upstream.