Hello, today some while ago i configured a DNS on Debian successfully. I ma writting this post using my DNS. Here is the configuration method of DNS.
Step1. At the very beginning I installed the package bind9 that is used for configuring DNS at Debian. I just write down the command,
apt-get install bind9
It will install the package bind9 within few minutes and now, we are ready to configure our DNS server.
Edit file named.conf in directory /etc/bind . And in this tutor, the domain is test.com.
vi /etc/bind/named.conf
Here we have to add the following lines at the end last ‘Zone’ paragraph.
zone “test.com” {
type master;
file “/etc/bind/test”;
};
zone “1.62.10.in-addr.arpa.” {
type master;
file “/etc/bind/reverse”;
};
after it, save and exit with type “:wq!”
and now we have to make the zone file and reverse zone file, in directory as we edited in file named.conf
vi /etc/bind/test
and you have to put some configuration like this;
$TTL 604800
1.62.10.in-addr.arpa. IN SOA debian. root.test.com. (
1 ;
Serial 604800 ;
Refresh 86400 ;
Retry 2419200 ;
Exipire 604800 ) ;
Negative Cache TTL
;
@ IN NS debian.test.com.
@ IN MX 10 debian.test.com.
debian IN A 10.62.1.100
www IN CNAME debian.test.com.
then save and exit, with type “:wq!“
after it, you must create reverse zone file
vi /etc/bind/reverse
then put some configuration like this;
test’s zone file :
$TTL 64800
@ IN SOA debian root.test.com (
1 ;
serial 7200 ;
refresh 7200 ;
retry 36000 ;
expire 7200 ) ;
mimimum
;
@ IN NS debian.test.com.
debian IN A 10.62.1.100
100 IN PTR debian.test.com.
then save and exit, with type “:wq!“
and now you should configure dns resolver.
Edit file of directory /etc/resolv.conf
and put some configuration there!
vi /etc/resolv.conf
And add the following lines.
search test.com
nameserver 10.62.1.100
then save and exit with type “:wq!“
and now you should configure the host file.
vi /etc/hosts
put some configuration there!
127.0.0.1 localhost
10.62.1.100 debian.test.com debian
Note: IP address in that domain is 10.62.1.100
and that host has domain test.com
Hope to get suggestion from you.