I am trying to set up a BIND configuration with an Apache webserver. What I am trying to achieve is to by using the URL www.exampler.net access the content that can be found on my Apache webserver's /var/www/html folder. I am doing this on one machine which has the IP address 192.168.1.4.When I dig www.exampler.net while my Wired connection is on, it will only find Google's nameservers, but why I turn off my Wired connection it will instantly find my ns1.exampler.net. Why is that?Furthermore by writing www.exampler.net into the browser it won't redirect me to my local website which can be found in /var/www/html but by writing 192.168.1.4 i it will./etc/bind/named.conf.localzone exampler.net{        type master;        file /etc/bind/zones/db.exampler.net;};/etc/bind/zones/db.exampler.net;; exampler.net = domain name;$TTL    604800exampler.net.   IN      SOA     ns1.exampler.net. admin.localhost. (                              2         ; Serial                         604800         ; Refresh                          86400         ; Retry                        2419200         ; Expire                         604800 )       ; Negative Cache TTL; name serversexampler.net.   IN      NS      ns1.exampler.net.; ip addressesns1     IN      A       192.168.1.4www     IN      A       192.168.1.4/etc/apache2/sites-available/000-default.conf<VirtualHost *:80>        ServerName exampler.net:80        ServerAlias www.exampler.net        ServerAdmin webmaster@localhost        DocumentRoot /var/www/html        ErrorLog ${APACHE_LOG_DIR}/error.log        CustomLog ${APACHE_LOG_DIR}/access.log combined</VirtualHost>I am using Ubuntu 14.04.1. I want to do this only locally, so that the hosts on my LAN server can use the given domain name to access the website that can be found on my Apache/NS server. Thanks in advance!
Why won't my BIND / Apache configuration work?
ubuntu;apache httpd;dns;bind
Once the DNS resolver finds a successful match, it stops looking for one. Turning off the wired connection probably makes your regular DNS servers inaccessible so Ubuntu keeps looking until it hits your local DNS server.It looks like www.exampler.net is already a registered domain that resolves to 64.233.171.121. Looking at it in chrome it looks like some guy's blog. You may want to use something more unique. Alternatively, you could set BIND up as a forwarder and then specify on the hosts that it's the only name server they should be using. named won't query upstream servers for zones it thinks it's authoritative for.Probably easier just to pick a different name, though.