Running own DNS Server is not a small matter. Here is a small guide for configuring own DNS Server with on Ubuntu with Web Interface on Cloud. Any Cloud Server cluster or node can work as DNS Server. The disadvantages outweigh advantages, that is the basic reason why most use some third party DNS Server for domain management. DNS Server should be from a reliable service provider.
Why Own DNS Server with BIND on Ubuntu with Web Interface is Not Commonly Used?
Usually vanity name server is used, except for a very big setup – like Google Inc, Wikipedia, almost all the web hosts, none uses own DNS server to avoid various security related issues like DNS Hijacking, DNS Poisoning, Advanced Persistent Threat and hundreds of dangerous problems which can lead to full blacklisting of the Own DNS Server’s IP. In other words, this is not a guide which works as replacement for DNS Server service provided by Rackspace Cloud DNS, CloudFlare etc. We would be happy to run own DNS Server for own purpose to fully get rid of vendor locking related issues. However, we can solve the Non-Authoritative Answer in other way.
Own DNS Server with BIND on Ubuntu with Web Interface
The IP/Domain should have a wildcard SSL Certificate in ideal situation. There are lot of Free/Open Source DNS Server Softwares, BIND is most commonly used. There is a way to get a web interface too. BIND stands for Berkeley Internet Name Domain. PowerDNS Free DNS Server is used for Mac and Windows. OpenStack Nova has a DNS Server function. DHCP is needed in order for MAAS to boot and control nodes. DigitalOcean has an easy way to have servers from various regions across the globe under one account. Ideally, that is what is required for a practical Own DNS Server with BIND on Ubuntu. Most commonly written guides to have own DNS Server with Bind is for one server configuration, which is written below.
---
On a fresh instance, first update and upgrade and install BIND :
1 2 | apt-get update -y && apt-get upgrade apt-get install bind9 bind9utils bind9-doc |
Next, we need to edit the Local
File :
1 | nano /etc/bind/named.conf.local |
Local File is a name, it is closer to our Apache’s vHost file or Nginx’s Default file. We need to edit accordion to our need :
1 2 3 4 5 6 7 8 9 10 11 12 | # replace thecustomizewindows.com with your domain name zone "thecustomizewindows.com" { type master; file "/etc/bind/zones/thecustomizewindows.com.db"; // allow-transfer { 12.68.192.1; }; // test it }; # reverse DNS. replace 12.68.192 with your network address in reverse notation zone "12.68.192.in-addr.arpa" { type master; file "/etc/bind/zones/rev.12.68.192.in-addr.arpa"; }; |
Second file is for the Forwarders :
1 2 3 4 5 6 | nano /etc/bind/named.conf.options # Edit forwarders { # Replace the IP with the provider's DNS server 123.123.123.123; }; |
Actually in real a directory is created and db.local
is copied :
1 | mkdir -p /etc/bind/zones && cp /etc/bind/db.local /etc/bind/zones/db.thecustomizewindows.com |
This file, finally should look like this :
1 2 3 4 5 6 7 8 9 10 11 | $TTL 604800 @ IN SOA localhost. root.localhost. ( 2 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; @ IN NS localhost. @ IN A 127.0.0.1 @ IN AAAA ::1 |
That ns2
should be another server with same kind of config. It is a dummy example.
As basically the dns server provider = you ; usually the file /etc/bind/db.127
closely matches to the need for reverse zone config, we need; we usually copy :
1 | cp /etc/bind/db.127 /etc/bind/zones/db.12.68.192 |
As we are providing random number for the IP, you should understand – an IP address of 123.45.6.7 would be flipped to look like 7.6.54.321. The first three are taken (7.6.54) and in-addr.arpa
is added. So finally it would look like – 7.6.54.in-addr.arpa
. Do with any website with a dedicated IP.
The file we copied, db.12.68.192
should look like this :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | $TTL 604800 @ IN SOA thecustomizewindows.com. admin.thecustomizewindows.com. ( 5 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; ; Name servers IN NS ns1.thecustomizewindows.com. IN NS ns2.thecustomizewindows.com. ; PTR records 1 IN PTR ns1.thecustomizewindows.com. 2 IN PTR ns2.thecustomizewindows.com. 3 IN PTR www.thecustomizewindows.com. |
Then restart BIND :
1 | /etc/init.d/bind9 restart |
We need to edit /etc/resolv.conf
; it should contain stuff like this :
1 2 | search thecustomizewindows.com name server 12.68.192.1 |
Webmin includes a module for BIND for the web interface. There are lot of third party softwares like this :
1 | https://github.com/jmazzi/dns-control |
For MaaS and DCHP, you can follow the Ubuntu’s guide :
1 2 | https://maas.ubuntu.com/docs/install.html https://maas.ubuntu.com/docs/configure.html |
Do not use other’s Domain name or IP for testing purpose. This is illegal work. You can test with your own serve without actually changing the name server against domain register’s control panel.
Tagged With bind dns web interface , ubuntu bind ui , dns server with web ui , dns server web ui , dns server BIND web interface , bind9 webinterface ubuntu , bind9 web interface , bind webui ubuntu , bind web interface , bind web gui