We have an RPi running a Midori browser against a web server located on the other side of a low-bandwidth WAN in a data centre. The RPi is on 'this side of the WAN' on a subnet of 10.14.9.0/24, and the webserver is in the datacentre on 'the other side of the WAN' on an IP of 10.10.17.15. The URL in the browser references a 'friendly name' webserver.abc.local of the webserver, which exists on the nameservers in the data centre, and which we have entered into the RPi's /etc/hosts file:
...
127.0.1.1 raspberrypi
10.10.17.15 webserver.abc.local
We have a resolv.conf file on the RPi that references these nameservers, but this causes undue traffic over the WAN to resolve 'webserver.abc.local' to its IP address of 10.10.17.15 several times every 60 seconds. So we renamed the resolv.conf file and added the abovementioned entry into the /etc/hosts file .
However it appears that the browser does not utilise the hosts file entry to resolve the IP address of webserver.abc.local, because the browser does not update. We also do not see any http traffic to 10.10.17.15 through the firewall that is located in the datacentre, between the WAN and the web server. We can also see countless attempts finding a nameserver on the WWW to do the DNS lookup, to no avail. When we restore resolv.conf, the browser works as expected, and we see http traffic through the firewall.
In Windows one needs to enable lmhosts file to cause the OS to first look at lmhosts before it uses a nameserver. Is it necessary to do the same in Raspbian, so that the browser is forced to look in /etc/hosts file to resolve an IP address, before it attempts to use a nameserver? Or is there some other root cause for the browser failing to first check the hosts file for IP resolution? Is there a way to test access into the hosts file, to confirm whether the entry inside is correct? It appears nslookup does an external DNS lookup into the WWW, i.e. it does not reference the hosts file.
Thank you.