pornophobic
Member
- Messages
- 32
- Reaction score
- 1
- Points
- 8
I'm not very good with introductory spiel, so here are some points:
It's always a good idea to run an update first. This ensures that any official bug fixes and security updates are installed.
What is DNS?
DNS stands for "Domain Name System". It is used to translate domain names (example.com) to IP addresses.
What is BIND?
BIND stands for "Berkeley Internet Name Daemon" it is the most widely used DNS server on the whole entire internet.
What is named?
named (pronounced name-dee) is the main software in the BIND package. It stands for name daemon.
Registering your nameservers.
Luckily I had thought well in advance for writing this tutorial and provided instruction on how to do this here.
Back up original files!
This is an important thing to note when changing any configuration anything on Linux.
Issue these commands to back up the files we will be changing:
Edit /etc/resolv.conf
Open the file with vim:
You will see this:
These two lines tell Fedora where to find external DNS servers so it can resolve domains to ips when using programs like wget, yum, curl, or any other software that will need to resolve domains.
The two original IPs in this file MUST remain in this file or DNS resolution will fail.
The two IPs are also Google's public DNS servers.
You should now change it to something like this:
What these changes do is tell the system to search for hosts under the domain 'example.com' in hosts or other configurations. This way, you will not need to type out 'subdomain.example.com' and can just use 'subdomain' instead.
The final line you added tells the system to also use the local name server.
Edit /etc/named.conf
In order to be accessible to the internet, you should tell named to listen on any interface.
To do this, open up named.conf in vim:
Change the following:
To:
This will tell named to listen on all interfaces available to it so it is now accessible on all of your IPs, should you have more than one.
In the case that you do have more than one IP, and you want named to listen on only one external IP you can change it to this instead:
Make sure that localhost (127.0.0.1) is included and point to one of your IPs. The IP that you use should be the IP that you pointed your nameservers to when you registered them. Notice that the listen-on-v6 is commented out. This prevents named from listening on ipv6 because translating ipv4 to ipv6 is very outside of the scope of this article. If you do happen to know how to find your ipv6 address, then it should be entered after the ::1; entry.
NOTE:
If you are having trouble deciding on which IP to use, you can always just use the IP that shows up when you issue the following command:
In most cases, using the first example given will suffice. Using multiple IPs will be mentioned from time to time when optional.
- This tutorial is not a guide for installing webmin or other control panel.
- This tutorial assumes you have a fresh install of Fedora 18 (x64 or x86) on your x10VPS.
- This tutorial will walk you through and explain steps to set up the following:
- DNS Server (BIND 9.9) [Pt. 2]
- HTTP Server (Apache 2.4)
- PHP (PHP 5.4)
- MySQL Server (MySQL 5.5)
- Email Server (Postfix, dovecot)
- FTP Server (vsftpd)
- DNS Server (BIND 9.9) [Pt. 2]
- This tutorial will be followed by a few other tutorials directed at a Fedora 18 x10VPS.
- For the purposes of this tutorial I will be using the IP "172.16.24.234" and the domain "example.com". These are to be replaced with the external ip of your VPS and the domain you choose to use as your master domain.
- This tutorial is provided "as is" and written as I perform the actions. If you find any mistakes, errors or have any suggestions please feel free to PM me with them and I will deal with it accordingly!
It's always a good idea to run an update first. This ensures that any official bug fixes and security updates are installed.
Code:
yum -y update
Configuring DNS with BIND/named On Fedora 18
What is DNS?
DNS stands for "Domain Name System". It is used to translate domain names (example.com) to IP addresses.
What is BIND?
BIND stands for "Berkeley Internet Name Daemon" it is the most widely used DNS server on the whole entire internet.
What is named?
named (pronounced name-dee) is the main software in the BIND package. It stands for name daemon.
Registering your nameservers.
Luckily I had thought well in advance for writing this tutorial and provided instruction on how to do this here.
Back up original files!
This is an important thing to note when changing any configuration anything on Linux.
Issue these commands to back up the files we will be changing:
Code:
cp /etc/resolve.conf /etc/resolv.conf.bak
cp /etc/named.conf /etc/named.conf.bak
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.bak
Edit /etc/resolv.conf
Open the file with vim:
Code:
vim /etc/resolv.conf
You will see this:
Code:
nameserver 8.8.8.8
nameserver 8.8.4.4
These two lines tell Fedora where to find external DNS servers so it can resolve domains to ips when using programs like wget, yum, curl, or any other software that will need to resolve domains.
The two original IPs in this file MUST remain in this file or DNS resolution will fail.
The two IPs are also Google's public DNS servers.
You should now change it to something like this:
Code:
search example.com
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 127.0.0.1
What these changes do is tell the system to search for hosts under the domain 'example.com' in hosts or other configurations. This way, you will not need to type out 'subdomain.example.com' and can just use 'subdomain' instead.
The final line you added tells the system to also use the local name server.
Edit /etc/named.conf
In order to be accessible to the internet, you should tell named to listen on any interface.
To do this, open up named.conf in vim:
Code:
vim /etc/resolv.conf
Change the following:
Code:
listen-on port 53 { 127.0.0.1; };
listen-on-v6 port 53 { ::1; };
To:
Code:
listen-on port 53 { any; };
listen-on-v6 port 53 { any; };
This will tell named to listen on all interfaces available to it so it is now accessible on all of your IPs, should you have more than one.
In the case that you do have more than one IP, and you want named to listen on only one external IP you can change it to this instead:
Code:
listen-on port 53 { 127.0.0.1; 172.16.24.234;};
#listen-on-v6 port 53 { ::1;}
Make sure that localhost (127.0.0.1) is included and point to one of your IPs. The IP that you use should be the IP that you pointed your nameservers to when you registered them. Notice that the listen-on-v6 is commented out. This prevents named from listening on ipv6 because translating ipv4 to ipv6 is very outside of the scope of this article. If you do happen to know how to find your ipv6 address, then it should be entered after the ::1; entry.
NOTE:
If you are having trouble deciding on which IP to use, you can always just use the IP that shows up when you issue the following command:
Code:
ping `hostname`
In most cases, using the first example given will suffice. Using multiple IPs will be mentioned from time to time when optional.
Last edited: