Concept & How it Works DNS
DNS (Domain Name System) is a system that converts host names (such as linux.or.id) into IP addresses (such as 64.29.24.175) on all computers connected directly to the Internet. DNS can also change the IP address into a hostname.
DNS works and shaped like a tree hierarchy (tree). The top is a Top Level Domain (TLD) such as COM, ORG, EDU, MIL, etc.. Like the DNS tree has branches that sought from the base to the tip. At the time we find an address for example linux.or.id first TLD DNS server to ask about the DNS server serving the domain. Id eg ns1.id answered, after which he was asked about the DNS Server ns1.id responsible for. Or . id for example ns.or.id then he asked and answered linux.or.id ns.or.id on 64.29.24.175
Meanwhile, to change the IP to host name involves in-addr.arpa domain. Other domains such as domain in-addr.arpa any branching. An important point is its IP address is written in reverse order under the in-addr.arpa. For example, for IP address 64.29.24.275 linux.or.id process as an example: search server for ARPA, locate the server for in-addr.arpa, search the server for 64.in-addr.arpa, locate the server-addr.arpa 29.64.in , locate the server for 24.29.64.in-addr.arpa. And search information for 275.24.29.64.in-addr.arpa. Reversal of the order of the numbers can indeed be confusing.
DNS Server on Linux
DNS Server on Linux is usually run by a program called named. This program is part of the bind package which is coordinated by Paul Vixie of the Internet Software Consortium. This program is usually located in / usr / sbin / named and run at boot time from / etc / rc.d / init.d / named start. To be named is run on every boot insert named to the list of servers that have distart using ntsysv.
Configuration File
The configuration file for named is / etc / named.conf which is a text file as usual. These file formats such as C or Pascal program formats that each command ends with ';' and block commands in brackets with '{' and '}'. There are some blocks that are often used, namely:
options
to set the global server configuration and specify the default
zone
to set the configuration of DNS zones
Caching Only DNS Server
Caching Only DNS Server will find answers to questions DNS and remember the answer when you ask again. This will shorten the waiting time at the next DNS question, especially if you are using a slow connection such as a modem.
Configuration
Caching Only DNS configuration files are provided by Red Hat caching-nameserver in the package you just install the package and edit the file / etc / named.conf and add the following line in the block options:
forward first;
forwarders {
202.158.3.6;
202.158.3.7;
};
Both of the above IP address is the IP address for my ISP's DNS servers that your ISP is different CBN if you have to replace it.
Creating Your Own Domain
In this section we will create a domain for the local network (LAN) such as intra.aki. It is better to use a domain that actually does not exist on the Internet so that we do not interfere with any domain. Keep in mind that not all characters are allowed to be the name of the host is allowed only AZ, az, 0-9 and '-' character. Besides the host name that does not depend on uppercase or lowercase letters, so linux.intra.aki and LINUX.Intra.AKI are the same. We are still editing the file from caching-nameserver package.
Additional in / etc / named.conf
First we edit the file / etc / named.conf to add the following line:
zone "intra.aki" {
type master;
notify no;
file "intra.aki";
}
Which means that we create a domain zone where we are the masters intra.aki domain (type master) but we do not want it spread to the internet domain (notify no) and information about members of the domain itself is stored in files in the directory specified intra.aki by keyword directory that contains the options from the block / var / named
Zone files intra.aki
Then we make intra.aki zone file that contains information about a domain member
; Zone file for intra.aki
@ IN SOA ns.intra.aki. root.intra.aki. (
2000091401; serial
8H; refresh
3H; retry
1W; expire
1D; default_ttl
)
NS ns
A 192.168.1.100
MX 10 linux.intra.aki.
MX 20 other.extra.aki.
localhost A 127.0.0.1
linux A 192.168.1.100
A 192.168.1.100 ns
CNAME linux ftp
pop CNAME linux
www CNAME linux.intra.aki
cctv A 192.168.1.3
Note the '.' at the end of the domain name in this file. This zone file contains 9 Resource Record (RR): one SOA RR, the NS RR, three and four AA RR CNAME RR. SOA stands for Start Of Authority. The character "@" means the domain name of the zone is intra.aki so the second line above means
intra.aki. IN SOA ....
NS is the Name Server RR. There is no "@" at the beginning of the line because the line above it starts with '@'. Save time typing. So the NS line could also be written
intra.aki. IN NS ns
This tells the host where the DNS server for the domain name intra.aki the ns.intra.aki. 'Ns' is the name commonly used for the name server, but as an ordinary web server www.anu called his name be changed to anything.
SOA is the opening line for all the zone files and there should be one in each zone file. It describes the zone line, from which he came (host named ns.intra.aki), who is responsible for its content (root@intra.aki), version of the zone file (serial: 2000091401) and other parameters associated with caching and secondary DNS Server. Note that the hostname should ns.intra.aki the A RR. Not allowed to create a CNAME RR for a name that is mentioned in the SOA.
RR A defines the IP address of a host name, while CNAME defines an alias name of a host who has to refer to other RR.
There is one more type of RR in this file is MX or Mail eXchanger. RR serves to notify the mail system where to send e-mail to the address the email to seseorang@intra.aki in this linux.intra.aki or other.extra.aki. Number before the name is a priority MX host. RR with the lowest number (10) is host to send first email. If it does not work then e-mail can be sent to another host with a larger number such as other.extra.aki which has priority 20.
Reverse zone
Reverse zone is required to change the IP address of a name. This name is used by a variety of servers (FTP, IRC, WWW, etc.) to determine whether you are allowed to access the service or the extent to which priority is given to you. To gain full access to all necessary services on the Internet a reverse zone.
Additional in / etc / named.conf
Add the following line in / etc / named.conf
zone "1.168.192.in-addr.arpa" {
notify no;
type master;
file "192.168.1";
}
As before we make meaning 1.168.192.in-addr.arpa domain zones that are not distributed to internet and stored in the file / var/named/192.168.1
192.168.1 zone file
Now we create the zone file 192.168.1 1.168.192.in-addr.arpa domain for the following:
; Zone file for 1.168.192.in-addr.arpa reverse zone (192.168.1.x)
@ IN SOA ns.intra.aki. root.intra.aki. (
2000072801; serial
28 800; refresh
7200; retry
604 800; expire
86 400; default_ttl
)
@ IN NS ns.intra.aki.
100 IN PTR linux.intra.aki.
3 IN PTR cctv.intra.aki.
There is a new one here that PTR RR whose function is to map the IP to the hostname
Security
If you install DNS server on a computer that serves as a gateway between your internal network to the Internet network as well as your DNS server does not service the request from the outside (or DNS caching only DNS for local network only) you can create named to serve only the local network only with add the following line in the block options:
listen-on {127.0.0.1; 192.168.1.100;};
So named only open port on the loopback interface (127.0.0.1) and eth0 (192.168.1.100).
DNS (Domain Name System) is a system that converts host names (such as linux.or.id) into IP addresses (such as 64.29.24.175) on all computers connected directly to the Internet. DNS can also change the IP address into a hostname.
DNS works and shaped like a tree hierarchy (tree). The top is a Top Level Domain (TLD) such as COM, ORG, EDU, MIL, etc.. Like the DNS tree has branches that sought from the base to the tip. At the time we find an address for example linux.or.id first TLD DNS server to ask about the DNS server serving the domain. Id eg ns1.id answered, after which he was asked about the DNS Server ns1.id responsible for. Or . id for example ns.or.id then he asked and answered linux.or.id ns.or.id on 64.29.24.175
Meanwhile, to change the IP to host name involves in-addr.arpa domain. Other domains such as domain in-addr.arpa any branching. An important point is its IP address is written in reverse order under the in-addr.arpa. For example, for IP address 64.29.24.275 linux.or.id process as an example: search server for ARPA, locate the server for in-addr.arpa, search the server for 64.in-addr.arpa, locate the server-addr.arpa 29.64.in , locate the server for 24.29.64.in-addr.arpa. And search information for 275.24.29.64.in-addr.arpa. Reversal of the order of the numbers can indeed be confusing.
DNS Server on Linux
DNS Server on Linux is usually run by a program called named. This program is part of the bind package which is coordinated by Paul Vixie of the Internet Software Consortium. This program is usually located in / usr / sbin / named and run at boot time from / etc / rc.d / init.d / named start. To be named is run on every boot insert named to the list of servers that have distart using ntsysv.
Configuration File
The configuration file for named is / etc / named.conf which is a text file as usual. These file formats such as C or Pascal program formats that each command ends with ';' and block commands in brackets with '{' and '}'. There are some blocks that are often used, namely:
options
to set the global server configuration and specify the default
zone
to set the configuration of DNS zones
Caching Only DNS Server
Caching Only DNS Server will find answers to questions DNS and remember the answer when you ask again. This will shorten the waiting time at the next DNS question, especially if you are using a slow connection such as a modem.
Configuration
Caching Only DNS configuration files are provided by Red Hat caching-nameserver in the package you just install the package and edit the file / etc / named.conf and add the following line in the block options:
forward first;
forwarders {
202.158.3.6;
202.158.3.7;
};
Both of the above IP address is the IP address for my ISP's DNS servers that your ISP is different CBN if you have to replace it.
Creating Your Own Domain
In this section we will create a domain for the local network (LAN) such as intra.aki. It is better to use a domain that actually does not exist on the Internet so that we do not interfere with any domain. Keep in mind that not all characters are allowed to be the name of the host is allowed only AZ, az, 0-9 and '-' character. Besides the host name that does not depend on uppercase or lowercase letters, so linux.intra.aki and LINUX.Intra.AKI are the same. We are still editing the file from caching-nameserver package.
Additional in / etc / named.conf
First we edit the file / etc / named.conf to add the following line:
zone "intra.aki" {
type master;
notify no;
file "intra.aki";
}
Which means that we create a domain zone where we are the masters intra.aki domain (type master) but we do not want it spread to the internet domain (notify no) and information about members of the domain itself is stored in files in the directory specified intra.aki by keyword directory that contains the options from the block / var / named
Zone files intra.aki
Then we make intra.aki zone file that contains information about a domain member
; Zone file for intra.aki
@ IN SOA ns.intra.aki. root.intra.aki. (
2000091401; serial
8H; refresh
3H; retry
1W; expire
1D; default_ttl
)
NS ns
A 192.168.1.100
MX 10 linux.intra.aki.
MX 20 other.extra.aki.
localhost A 127.0.0.1
linux A 192.168.1.100
A 192.168.1.100 ns
CNAME linux ftp
pop CNAME linux
www CNAME linux.intra.aki
cctv A 192.168.1.3
Note the '.' at the end of the domain name in this file. This zone file contains 9 Resource Record (RR): one SOA RR, the NS RR, three and four AA RR CNAME RR. SOA stands for Start Of Authority. The character "@" means the domain name of the zone is intra.aki so the second line above means
intra.aki. IN SOA ....
NS is the Name Server RR. There is no "@" at the beginning of the line because the line above it starts with '@'. Save time typing. So the NS line could also be written
intra.aki. IN NS ns
This tells the host where the DNS server for the domain name intra.aki the ns.intra.aki. 'Ns' is the name commonly used for the name server, but as an ordinary web server www.anu called his name be changed to anything.
SOA is the opening line for all the zone files and there should be one in each zone file. It describes the zone line, from which he came (host named ns.intra.aki), who is responsible for its content (root@intra.aki), version of the zone file (serial: 2000091401) and other parameters associated with caching and secondary DNS Server. Note that the hostname should ns.intra.aki the A RR. Not allowed to create a CNAME RR for a name that is mentioned in the SOA.
RR A defines the IP address of a host name, while CNAME defines an alias name of a host who has to refer to other RR.
There is one more type of RR in this file is MX or Mail eXchanger. RR serves to notify the mail system where to send e-mail to the address the email to seseorang@intra.aki in this linux.intra.aki or other.extra.aki. Number before the name is a priority MX host. RR with the lowest number (10) is host to send first email. If it does not work then e-mail can be sent to another host with a larger number such as other.extra.aki which has priority 20.
Reverse zone
Reverse zone is required to change the IP address of a name. This name is used by a variety of servers (FTP, IRC, WWW, etc.) to determine whether you are allowed to access the service or the extent to which priority is given to you. To gain full access to all necessary services on the Internet a reverse zone.
Additional in / etc / named.conf
Add the following line in / etc / named.conf
zone "1.168.192.in-addr.arpa" {
notify no;
type master;
file "192.168.1";
}
As before we make meaning 1.168.192.in-addr.arpa domain zones that are not distributed to internet and stored in the file / var/named/192.168.1
192.168.1 zone file
Now we create the zone file 192.168.1 1.168.192.in-addr.arpa domain for the following:
; Zone file for 1.168.192.in-addr.arpa reverse zone (192.168.1.x)
@ IN SOA ns.intra.aki. root.intra.aki. (
2000072801; serial
28 800; refresh
7200; retry
604 800; expire
86 400; default_ttl
)
@ IN NS ns.intra.aki.
100 IN PTR linux.intra.aki.
3 IN PTR cctv.intra.aki.
There is a new one here that PTR RR whose function is to map the IP to the hostname
Security
If you install DNS server on a computer that serves as a gateway between your internal network to the Internet network as well as your DNS server does not service the request from the outside (or DNS caching only DNS for local network only) you can create named to serve only the local network only with add the following line in the block options:
listen-on {127.0.0.1; 192.168.1.100;};
So named only open port on the loopback interface (127.0.0.1) and eth0 (192.168.1.100).
Labels:
Network
Thanks for reading Setting DNS Server. Please share...!
0 Komentar untuk "Setting DNS Server"