How can i create my own DNS Server?

For many out there, DNS is handled by your Broadband router, and not something you need to worry about. However as your home network grows, having your own DNS server might be something of use to you, especially if you’re not building your life around Windows.

I’ve just had to follow these instructions to get a DNS server working as part of network segregation where I work this weekend, so our developers can live on their own self contained network segment in the most part.

Some things worth noting about setting up your own DNS, while you can add domain names and IP’s for anything you want, and if the forwarder address can cope with it, ping times will be good, however for local servers on the same domain, you will 10% want to make sure that the reverse DNS is setup or ping’s will seem REALLY slow..!!! (10 seconds for a ping..

Something else worth knowing, if you decide to use Webmin to do this, from the interface side, it has an uncanny knack of ocassionally corrupting your conf files

If you need underscores _ in your domain name, create a cname to the domain name as underscores don’t appear to be supported.

Step 3: Configure the main Bind files. Usually, if you install Bind from the source code, you will have to edit the file named.conf. However, Ubuntu provides you with a pre-configured Bind, so we will edit another file:Code:

sudo vi /etc/bind/named.conf.local

This is where we will insert our zones. By the way, a zone is a domain name that is referenced in the DNS serverInsert this in the named.conf.local file:Code:

The zone definition file is where we will put all the addresses / machine names that our DNS server will know. You can take the following example:Code:

// replace example.com with your domain name. do not forget the . after the domain name!// Also, replace ns1 with the name of your DNS server
example.com. IN SOA ns1.example.com. admin.example.com. (
// Do not modify the following lines!
2006081401
28800
3600
604800
38400
)
// Replace the following line as necessary:
// ns1 = DNS Server name
// mta = mail server name
// example.com = domain name
example.com. IN NS ns1.example.com.
example.com. IN MX 10 mta.example.com.
// Replace the IP address with the right IP addresses.
www IN A 192.168.0.2
mta IN A 192.168.0.3
ns1 IN A 192.168.0.1