Previous Page | Next Page

  1. Agustin's Linux Manual
  2. Networks & Servers
  3. About the Author
  4. Table of Contents
  5. IP Addresses Networks and Subnets
  6. Network Classes
  7. IP Address in Decimal Notation
  8. Sub-netting
  9. Designing Subnets
  10. Allocating Subnets
  11. Defining Host Addresses
  12. Variable Length Subnet Mask
  13. Routing Protocols
  14. Classless Internet Domain Routing
  15. Servers - Chapter 9
  16. Apache Web Server
  17. Configuring Apache
  18. Uploading Web Pages
  19. Apache Overview
  20. MIMEMagic
  21. DNS Servers
  22. Welcome to Webmin
  23. Creating the Master Domain
  24. Adding the Reverse Zone
  25. Querying the DNS server
  26. Adding Virtual Domain to DNS Server
  27. Reverse Zone for Virtual Zone
  28. Binding IP Address for Virtual Domain
  29. Virtual Web Hosting
  30. DNS Security Options
  31. FTP Server
  32. Securing the FTP Server
  33. Email Server
  34. Postfix Configuration
  35. Dealing with Identical Users
  36. Configuring Email Clients
  37. Configuring Outlook
  38. Samba Server
  39. Configuring SAMBA Server
  40. The smb.conf File
  41. smb.conf Analysis
  42. Adding Users to Samba

DNS Servers

If you ever thought of becoming an ISP, Then keep reading this book.
DNS is the mother of the Internet (Domain Name server). The DNS server is responsible for translating IP addresses into actual names. For example when you type in your web browser: (

Before a web browser can request a web page sitting on the web server at that domain, first the browser contacts the nearest DNS server to query an IP address that matches that name.

But how does it actually work?
To answer this question, it is much better setting it up than explaining how it works.

Setting up the DNS Server

Setting up the DNS server is quite simple. Most, if not all, Linux distributions come with Bind (Berkley Internet Name Daemon) version 8 or 9.

Most likely, it was installed during your Linux installation, but if not refer to software installation in this book to install it. I really recommend it to be installed during the initial Linux installation simply because generates a serial number for it (known as secret).

To configure the DNS server the named.conf file is used

  • /etc/named.conf
  • Directories: /var/named

The named.conf file will point to /var/named in order to query each zone. Every time you create a zone, a file will be created in the /var/named directory.

Before you make any changes make a backup copy of this file:

      # cp named.conf named.conf.original

# vi named.conf

// generated by // secret must be the same as in /etc/rndc.conf key "key" { algorithm hmac-md5; secret "c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K"; }; controls { inet allow { any; } keys { "key"; }; }; options { pid-file "/var/run/named/"; directory "/var/named"; /* * If there is a firewall between you and name servers you want * to talk to, you might need to uncomment the query-source * directive below. Previous versions of BIND always asked * questions using port 53, but BIND 8.1 uses an unprivileged * port by default. */ // query-source address * port 53; }; // // a caching only nameserver config // zone "." { type hint; file ""; }; zone "" { type master; file "named.local"; };

Observe that by default there are only two zones. Do not modify these two zones. By the way you should do an ls to /var/named, see that currently it holds two files and named.local.

When creating zones, you can name it whatever you want; but be consistent so your work will be professional (normally you will be using your domain name).

Editing the named.conf file can be done in several ways: manually, pre-configured bash script or using utilities.

I think that it is time to introduce another powerful administration utility. This utility can be used for any Linux flavor. Again thanks to the open source movement this utility comes free with most Linux distributions.