Difference between revisions of "Trillex installing dns"
Line 1: | Line 1: | ||
= Installing and Configuring a Linux DNS server with zone file = | = Installing and Configuring a Linux DNS server with zone file = | ||
Please note that this is done on a Ubuntu server. It can and probably will differ depending on the distro used. | Please note that this is done on a Ubuntu server. It can and probably will differ depending on the distro used. | ||
+ | |||
+ | PLEASE NOTICE THAT, IF NOT LOGGED IN A SUPERUSER, YOU WILL NEED TO USE '''SUDO''' FOR ALL OF THESE COMMANDS! | ||
== Installing the DNS Daemon (Bind9) == | == Installing the DNS Daemon (Bind9) == | ||
Bind9 (Or generally bind) is the standard DNS server daemon for Linux. Install it by typing: | Bind9 (Or generally bind) is the standard DNS server daemon for Linux. Install it by typing: | ||
Line 31: | Line 33: | ||
=== DNS Forwarder === | === DNS Forwarder === | ||
Since, on this school, we are stuck behind a "master" server, we will need to add that DNS as a forwarder so we can actually get responses back. | Since, on this school, we are stuck behind a "master" server, we will need to add that DNS as a forwarder so we can actually get responses back. | ||
+ | To find your DNS, you can type | ||
+ | |||
+ | cat /etc/resolv.conf | ||
+ | |||
+ | The nameserver will be the DNS server here. | ||
+ | |||
+ | Now edit the file '''/etc/bind/named.conf.options'''. | ||
+ | |||
+ | Uncomment the forwarder so it looks like this: | ||
+ | |||
+ | forwarders { | ||
+ | 172.16.4.77; | ||
+ | }; |
Revision as of 11:26, 17 February 2009
Contents
Installing and Configuring a Linux DNS server with zone file
Please note that this is done on a Ubuntu server. It can and probably will differ depending on the distro used.
PLEASE NOTICE THAT, IF NOT LOGGED IN A SUPERUSER, YOU WILL NEED TO USE SUDO FOR ALL OF THESE COMMANDS!
Installing the DNS Daemon (Bind9)
Bind9 (Or generally bind) is the standard DNS server daemon for Linux. Install it by typing:
sudo apt-get install bind9
This will install the program. Wait for it.
Configuring the DNS Daemon (Bind9)
You will need to set up the DNS domain name as well as a DNS forwarder.
Domain Name
Domain name can can be changed in the file /etc/bind/named.conf.local Right now the file is either blank or filled out with a lot of commented lines. Just delete them all and insert this:
# This is the zone definition. replace example.com with your domain name zone "example.com" { type master; file "/etc/bind/zones/example.com.db"; };
# This is the zone definition for reverse DNS. replace 0.168.192 with your network address in reverse notation - e.g my network address is 192.168.0 zone "0.168.192.in-addr.arpa" { type master; file "/etc/bind/zones/rev.0.168.192.in-addr.arpa"; };
Replace example.com with your own domain name (I chose trillex.dk). Also change the "reverse DNS" with your IP. Remember to do it backwards, as explained in the comments. What it essentially does is point towards the zone files it will use.
DNS Forwarder
Since, on this school, we are stuck behind a "master" server, we will need to add that DNS as a forwarder so we can actually get responses back. To find your DNS, you can type
cat /etc/resolv.conf
The nameserver will be the DNS server here.
Now edit the file /etc/bind/named.conf.options.
Uncomment the forwarder so it looks like this:
forwarders { 172.16.4.77; };