How to configure DNS Server on Ubuntu Server 11.04

DNS Server is a server with domain name resolution function. In this article, we will detail the steps to install and configure DNS Server on Linux with Ubuntu Server version 11.04.

DNS Server is a server with domain name resolution function. In this article, we will detail the steps to install and configure DNS Server on Linux with Ubuntu Server version 11.04.

1. Install

After setting a static IP address for the server to take the DNS Server role, you perform the following commands to install the BIND9 package (using the DNS service configuration on Linux):

# sudo -i
# apt-get update
# apt-get install bind9

How to configure DNS Server on Ubuntu Server 11.04 Picture 1How to configure DNS Server on Ubuntu Server 11.04 Picture 1

After the installation is successful, you get the main directory, / etc / bind . In this directory, you will configure the following files:

/etc/bind/named.conf.local
/etc/bind/db.local

DNS database file (eg /etc/bind/db.hoanghac.org )

2. Configuration

First, open the file /etc/bind/named.conf.local and add a new zone, such as hoanghac.org :

zone "hoanghac.org" {
type master;
file "/etc/bind/db.hoanghac.org";
};

Next, create the DNS database file /etc/bind/db.hoanghac.org by copying the content from the sample file /etc/bind/db.local :

# cp /etc/bind/db.local /etc/bind/db.hoanghac.org

At this point, edit the file /etc/bind/db.hoanghac.org by replacing localhost. equal to the full name of the DNS server (FQDN). Replace 127.0.0.1 with the IP address of DNS Server and root.localhost to an exact email address, but use the "." instead of the "@" symbol, you also create a record (A) corresponding to ns.hoanghac.org . The contents of the file will look like this:

;
; BIND dữ liệu tập tin cho địa chỉ loopback interface
;
$ TTL 604800
@ IN SOA ns.hoanghac.org. root.hoanghac.org. (
2 ; Serial
604800; Refresh
86400; Retry
2419200; Expire
604800); Negative Cache TTL
;
@ IN NS ns.hoanghac.org.
@ IN A 192.168.1.10
@ IN AAAA :: 1
ns IN A 192.168.1.10

Next, restart the BIND9 service for the configuration operations to take effect:

# /etc/init.d/bind9 restart

3. Check

To check the performance of the DNS Server, use the ping command as follows:

# ping ns.hoanghac.org

4 ★ | 2 Vote