Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Amazing! I can’t believe I got my own DNS server. Thank you!
The only problem is all queries are denied, the /var/log/syslog logs are like below:
MyServer named[24685]: client MyClientIP#7288 (client79.dropbox.com): query (cache) 'client79.dropbox.com/A/IN' denied
MyServer named[24685]: client MyClientIP#39385 (safebrowsing.google.com): query (cache) 'safebrowsing.google.com/A/IN' denied
Here is my config:
acl goodclients{
MyClientIP;
localhost;
localnets;
};
options {
directory "/var/cache/bind";
recursion yes;
allow-query { goodclients; };
forwarders {
8.8.8.8;
8.8.4.4;
};
forward only;
dnssec-enable yes;
dnssec-validation yes;
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
};
Hi Justin thanks for this article, I have my DNS up and running on my Ubuntu machine. I do have one small problem I can’t seem to figure out. I am running my web server on the same computer as the DNS server, when I type in the domain name of my webpage from within the LAN it takes me to the router login page which is the gateway, it works fine from outside the LAN as the domain is registered with no-ip.com and the router forwards the request to the correct computer, the problem is only when within the LAN. if I put in 127.0.0.1, localhost or 192.168.1.20 I get the website if I put in the actual domain name I get this page can’t be found or the router login page, I must have something not setup correctly within the local settings of my new DNS, I hope you can help me sort this out.
This comment has been deleted
Justin nice article. But I have one problem with the localhost address vs. a specified ip address for my BIND DNS server. I noticed in your DIG example it’s pointing to a specific ip address. Ex: SERVER: 192.0.2.1#53(192.0.2.1). This would be what you would expect for the setup.
How do I setup my server to point to my specified IP 172.16.y.z, instead of 127.0.0.1? I had already tried editing /etc/network/interfaces and /etc/bind/named.conf.options. I have Ubuntu Server LTS 14.04.1 and current installed updates. I’m running BIN9.9.5.
Given that I’m setting up a DNS server on my droplet, are there any good ways to verify that only say, my devices are able to use it as a DNS server versus just anyone on the internet? Using an IP whitelist in this case isn’t effective given I can connect to many wifis via my laptop and my phone IP isn’t guaranteed.
Has anyone solved this problem?
Thank you so much for the great article, I want to build a DNS server for about a 100-150 devices. What would you recommend should the system requirements be for the server? I am planning to build a DNS forwarding server as described in the article. Thank you!
Justin,
It was probably done with permission, but did you know that someone by the name of John Capital submitted an exact duplicate of your work to ubtutorials.com, here:-
http://ubtutorials.com/tutorial/440/how-configure-bind-caching-or-forwarding-dns-server-ubuntu-1404
some 16 days after you uploaded this article? I checked the copy for attribution but found none, so i thought I’d mention it here. Please accept my apology for troubling you if this is old news and something you were aware of…
C
Ubuntu 15.10 with LAMP I just, successfully, installed OpenVPN on a fresh droplet. I like the idea of having a DNS cache from both privacy and speed points of view, so I followed this tutorial in an attempt to get this. What I know about DNS is somewhere between nada and nada+0.5. Now my DNS is all f&*ked up. DNSLeaktest shows my apt’s ip instead of the VPN’s. Everything else takes an age to resolve. IP’s between my clients and my droplet (which has openVPN and the DNS server) are a mystery to me and so probably the problem.
Not sure what log info to include, here’s some if more helps please ask…
Thanks.
<syslog> Apr 22 04:35:31 Fionnuisce NetworkManager[745]: <info> (eth1): DHCPv4 state changed unknown -> timeout Apr 22 04:35:31 Fionnuisce NetworkManager[745]: <info> (eth1): canceled DHCP transaction, DHCP client pid 3986 Apr 22 04:35:31 Fionnuisce NetworkManager[745]: <info> (eth1): DHCPv4 state changed timeout -> done Apr 22 04:35:31 Fionnuisce NetworkManager[745]: <info> (eth1): device state change: ip-config -> failed (reason ‘ip-config-unavailable’) [70 120 5] Apr 22 04:35:31 Fionnuisce NetworkManager[745]: <info> Connection ‘Wired connection 1’ failed to autoconnect; 1 tries left Apr 22 04:35:31 Fionnuisce NetworkManager[745]: <info> Disabling autoconnect for connection ‘Wired connection 1’. Apr 22 04:35:31 Fionnuisce NetworkManager[745]: <info> Disabling autoconnect for connection ‘Wired connection 1’; setting retry of 300. Apr 22 04:35:31 Fionnuisce NetworkManager[745]: <warn> (eth1): Activation: failed for connection ‘Wired connection 1’ Apr 22 04:35:31 Fionnuisce NetworkManager[745]: <info> (eth1): device state change: failed -> disconnected (reason ‘none’) [120 30 0] Apr 22 04:35:31 Fionnuisce NetworkManager[745]: <info> Device ‘eth1’ has no connection; scheduling activate_check in 0 seconds. </syslog>
<etc/network/interfaces>
auto lo iface lo inet loopback
auto eth0 iface eth0 inet6 static address 2604:A880:0000:1010:0000:0000:05E9:A001 netmask 64 gateway 2604:A880:0000:1010:0000:0000:0000:0001 autoconf 0 dns-nameservers 8.8.8.8
iface eth0 inet static address xxx.xxx.x.xxx # droplet ip netmask 255.255.255.0 gateway xxx.xxx.x.xxx # droplet ip dns-nameservers 8.8.8.8 up ip addr add 10.13.0.5/16 dev eth0 <//etc/network/interfaces>
<DNS section of ‘/etc/openvpn/server.conf’> push “dhcp-option DNS localhost” push “dhcp-option DNS 8.8.8.8” push “dhcp-option DNS 8.8.4.4” </DNS section of ‘/etc/openvpn/server.conf’>
Thank you so much for this wonderful tutorial. I am implementing DNS Sandbox as a part of Masters Project. I’m replicating the entire Domain Name Servers by implementing my own set of domains (ex: ex1.example.test.nik) in cloudlab using linux VMs. In this implementation, I have implemented my own root(.) server, TLD(nik) server, Secondary Level Domain(test) server and Ternary Level Domain(example). I am also implementing recursive resolver(which is explained here as Caching DNS Server) and stub resolver.
Right now, I am stuck up with the implementation of the Recursive resolver. Any help would be highly appreciated. Could you please let me know how to configure Recursive Resolver(RR) - I mean how will it contact the root server? Where should I mention the information(IP) of root server in RR’s configuration file?
Any sort of help or guidance is highly appreciated. Please let me know if you need more details of my implementation.
Hi guys,
I am facing a strange behavior by Bind9. I am working in mixed environment (windows and linux cleint and server machines). I have recently configured a Bind9 as a private/internal DNS server. It’s working fine with windows clients but unable to ping the linux machines. However, nslookup does resolve the linux hosts. Following is the configuration files.
$ sudo cat /etc/bind/named.conf // This is the primary configuration file for the BIND DNS server named. // // Please read /usr/share/doc/bind9/README.Debian.gz for information on the // structure of BIND configuration files in Debian, BEFORE you customize // this configuration file. // // If you are just adding zones, please do that in /etc/bind/named.conf.local
include “/etc/bind/named.conf.options”; include “/etc/bind/named.conf.local”; include “/etc/bind/named.conf.default-zones”;
$ sudo cat /etc/bind/named.options
options { directory “/var/cache/bind”;
// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk. See http://www.kb.cert.org/vuls/id/800113
// If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0's placeholder.
// forwarders {
// 0.0.0.0;
// };
//========================================================================
// If BIND logs error messages about the root key being expired,
// you will need to update your keys. See https://www.isc.org/bind-keys
//========================================================================
allow-query { localhost; 10.0.0.0/24; };
allow-transfer { localhost; 10.0.0.0/24; };
allow-recursion { localhost; 10.0.0.0/24; };
dnssec-validation auto;
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { none; };
};
$ sudo cat /etc/bind/named.conf.local
// // Do any local configuration here //
// Consider adding the 1918 zones here, if they are not used in your // organization //include “/etc/bind/zones.rfc1918”; zone “test.local” { type master; file “/etc/bind/db.test.local”; };
zone “0.0.10.in-addr.arpa” { type master; file “/etc/bind/db.10”; };
Zone files details.
// // If you are just adding zones, please do that in /etc/bind/named.conf.local
include “/etc/bind/named.conf.options”; include “/etc/bind/named.conf.local”; include “/etc/bind/named.conf.default-zones”;
$ sudo cat /etc/bind/db.test.local
; BIND reverse data file for empty rfc1918 zone ; ; DO NOT EDIT THIS FILE - it is used for multiple zones. ; Instead, copy it, edit named.conf, and use that copy. ; $TTL 86400
@ IN SOA ns1.test.local. root.test.local. ( 1 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 86400 ) ; Negative Cache TTL ; IN NS ns1.test.local IN A 10.0.0.88 ;A Records ns1 IN A 10.0.0.88
;Linux host A record. host1 IN A 10.0.0.80
;Windows host A record. host2 IN A 10.0.0.81
$ sudo cat /etc/bind/db.10 ; BIND reverse data file for empty rfc1918 zone ; ; DO NOT EDIT THIS FILE - it is used for multiple zones. ; Instead, copy it, edit named.conf, and use that copy. ; $TTL 86400
@ IN SOA ns1.test.local. root.test.local. ( 1 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 86400 ) ; Negative Cache TTL ; IN NS ns1.test.local. IN A 255.255.255.0 88 IN PTR test.local 80 IN PTR host1. 81 IN PTR host2.
Windows clients are communicating 100% perfect nslookup and ping both are fine but when I use to ping a linux client machine the message I get is
“C:\Users\userq>ping host1 Ping request could not find host host1. Please check the name and try again.”
However nslookup resolve the name.
How to diagnose it. Thanks in advance.