How to Set Up a DNS Server on Debian
-
Upload
hamami-inkazo -
Category
Documents
-
view
227 -
download
0
Transcript of How to Set Up a DNS Server on Debian
-
7/25/2019 How to Set Up a DNS Server on Debian
1/3
1
How to set up a DNS Server on Debian
Today we are going to set up and configure a DNS Server on Debian 6.0 Squeeze. We will be using the bind9
package which does not come by default so we will need to install it. Open up a terminal and type:
root@debian6~# apt-get install bind9 dnsutils
There are four files which we we need to configure. Lets take the first. In a terminal type:
root@debian6~# nano /etc/bind/named.conf.local
I have used nano to open up the file but use whichever text editor you are happy with. Insert the following code into the
file:
# This is the zone definition. replace example.com with your domain name
zone informatika.edu {type master;
file /etc/bind/zones/informatika.edu.db;};
# This is the zone definition for reverse DNS. replace 1.168.192 with your
network address in reverse notation e.g my network address is 192.168.1zone 1.168.192.in-addr.arpa {type master;
file /etc/bind/zones/rev.1.168.192.in-addr.arpa;};
Replace informatika.edu with the name of your DNS domain (this is not the same as an active directory domain but
rather a name for your DNS zone).
Next up we shall configure the options file. In the terminal type:
root@debian6~# nano /etc/bind/named.conf.options
Within this file we need to modify the forwarder with the address of your ISPs DNS servers. So modify the file adding
the following:
forwarders {
8.8.8.8;
8.8.4.4;
};
Replace the addresses above with the addresses of your ISPs DNS servers.
Now we need to add the zones file:
root@debian6~# mkdir /etc/bind/zones
Now we need to configure it by typing:
root@debian6~# nano /etc/bind/zones/informatika.edu.db
(replace informatika.edu with your DNS domain).
To configure the file you will need to add the following:
http://comtech247.net/2012/09/17/how-to-set-up-a-dns-server-on-debian-6-0-squeeze/http://comtech247.net/2012/09/17/how-to-set-up-a-dns-server-on-debian-6-0-squeeze/ -
7/25/2019 How to Set Up a DNS Server on Debian
2/3
2
// replace informatika.edu with your domain name. do not forget the . after the
domain name!
// Also, replace ns1 with the name of your DNS server
informatika.edu. IN SOA ns1.informatika.edu.
// Do not modify the following lines!
2006081401
28800
3600
60480038400
)
// Replace the following line as necessary:
// ns1 = DNS Server name
// mail = mail server name
// informatika.edu = domain name
informatika.edu. IN NS ns1.informatika.edu.
informatika.edu. IN MX 10 mail.informatika.edu.
// Replace the IP address with the right IP addresses.
www IN A 192.168.1.4mail IN A 192.168.0.3
ns1 IN A 192.168.1.4
In the above code replace the following:
informatika.edu with your DNS domain name,
192.168.1.4 with your static DNS server address,
ns1.informatika.eduwith your computers hostname.dns-domain,
mail.informatika.edu is your mail server (if you have one). If you do modify the IP address to show this.
Next we have to create the reverse DNS zone file:
root@debian6~# nano /etc/bind/zones/rev.1.168.192.in-addr.arpa
Add the following code:
//replace example.com with your domain name, ns1 with your DNS server name.// The number before IN PTR example.com is the machine address of the DNS server
@ IN SOA ns1.informatika.edu admin.informatika.edu. (
2006081401;
28800;
604800;
604800;
86400
)
IN NS ns1.informatika.edu.
1 IN PTR informatika.edu
All that is left to do is restart bind:
root@debian6~# service bind9 restart
Dont forget to test the new configuration:
dig informatika.edu
-
7/25/2019 How to Set Up a DNS Server on Debian
3/3
3
About the Author
Hi I amChris Wakefieldthe owner ofComTech IT Support.I provide Windows and Linux based IT Support, laptop
repairs and computer repairs to both business and personal clients in and around Stirling.
For a list of what I can offer you why not visit my website www.comtech247.netwhere you will find a list of my
services, testimonials, blog and much more.
Source:
http://comtech247.net/2012/09/17/how-to-set-up-a-dns-server-on-debian-6-0-squeeze/
http://www.linkedin.com/pub/christopher-wakefield/28/9b9/731http://www.linkedin.com/pub/christopher-wakefield/28/9b9/731http://www.linkedin.com/pub/christopher-wakefield/28/9b9/731http://comtech247.net/http://comtech247.net/http://comtech247.net/http://www.comtech247.net/http://www.comtech247.net/http://www.comtech247.net/http://www.comtech247.net/http://comtech247.net/http://www.linkedin.com/pub/christopher-wakefield/28/9b9/731