In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to configure and use bind. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
A brief introduction to DNS
Each network interface connected to TCP/IP is identified by a unique 32-bit IP address, but because the numbers are complex, difficult to remember and have no visualization. As a result, people invented the domain name system, in which case we can use a name that is easy to understand and more vivid to identify a computer. In most cases, numeric addresses and domain names can be used interchangeably, but whether numeric addresses or domain names are used for network applications, the network is always based on IP addresses. Before the network can connect, the system must convert the domain name to an IP address. This is what the DNS server is for.
There are two common ways to convert a domain name to an IP address. An older method is to look up the hostname from a file called the "host table"; the other is to use a distributed database system called the Domain name Service (DNS) to convert the name to an IP address.
The host table is a simple text file that associates the IP address with the host name. In the Redhat Linux7.2 operating system, the host table file is / etc/hosts, and each list entry in the file contains an IP address and a host name associated with that address separated by a space.
Advantages of DNS:
DNS has good expandability. It does not rely on a single host table, but on a distributed database system, and will not get into trouble because of the growth of the database.
DNS ensures that information about the new host is propagated to other parts of the network if necessary. It can not only spread the information automatically, but also spread only the information needed.
? DNS works as follows:
If a DNS server receives a request for information about the host, it sends the request to an administrative server. The management server is the server responsible for maintaining accurate information about the query domain. When it responds to the request, the local server stores the answer information in the cache. When the local server receives another request for information about the off host, it answers the request itself.
II. Type of DNS server
DNS servers are divided into the following types:
1. "Cache-Only" DNS server:
A DNS server can not have all the host information on the international network, so it provides a forwarding method to forward the query requirements that its own DNS server cannot handle to the DNS server above, and then transmit the query results to the host that makes the query request. The "Cache-Only" DNS is that the host of the DNS server has nothing but its own information, and it forwards all the query requirements to other DNS servers.
2. "Primary" DNS server:
A fully functional DNS server that manages computer information for one or more "Domain" (domains). The related data are stored in the file directory of the server according to a certain format, and then loaded into the system when the server starts.
3. "Secondary" DNS server:
"Secondary" DNS server is also a fully functional DNS server, the difference is that its host data is not completely stored in the file directory where the server is located, but provided by some "Primary DNS".
III. Description of several parameters of DNS database file
The DNS database file has the following parameters to be explained:
Ttl
To force the parser to drop information after a period of time, each record has a corresponding "lifetime", or ttl for short. It is measured in seconds, and the default value of the system is 86400.
SOA
Describes an authorization area that represents authorization information for that area.
Serial
Represents the version number of the file in this area. This value will increase whenever the data in the area file changes. The version number is usually represented by the time it was modified. For example, 2002110501 represents the first amendment to the file on November 5, 2002. The slave server requests the SOA record of the master server after a certain period of time, and compares the sequence number value with the sequence number of the SOA record in the cache. If the value changes, the slave server transmits the data of the whole area from the master server.
Refresh
Specifies the interval, in seconds, that the slave server will check the SOA record of the master server.
Retry
It specifies the interval, in seconds, between the slave server and the master server after a request or zone refresh fails from the slave server.
Expire
Within a specified period of time, if the slave server cannot reach the master server (the master server is down), all zone data will be lost from the slave server.
Minimum
If the value of ttl is not explicitly specified, minimum is the default "lifetime".
A
Host record, which is used to associate a hostname with an IP address (corresponding).
NS
Used to specify the master name server and all slave name servers for a zone. A NS record points to a host name server for a given zone, as well as a resource record that contains the server hostname.
CNAME
The alias used to associate a host name with its canonical hostname, that is, the record provides an alias for the canonical hostname.
MX
Indicates the mail exchanger (mail server) and priority in this area.
Section 2: dns instance
Great Wall Pharmaceutical Company applied for the domain name greatwall.com. Now the company's DNS server address is 202.119.98.1, the domain name is ns.greatwall.com,web server address: 202.119.98.10, the domain name is www.greatwall.com, the FTP server address is 202.119.98.100, and the domain name is ftp.greatwall.com to try to install a DNS server for the company.
Analysis: because there are no special requirements, this is the simplest DNS server. Only the local zone needs to be set and can act as a cache, and the external DNS address can be resolved internally through this server.
The specific steps are as follows:
1. Obtain and install DNS server software.
The commonly used DNS server software in Linux/UNIX system is Bind,RedHatLinux7.2 version bind-9.1.3-4. You can get a new version from http://www.isc.org/products/BIND/ or ftp://ftp.isc.org/isc/bind9/.
If you downloaded the source code (take bind-9.2.1 as an example), do the following:
(1) enter the directory where the source code is located. For example: / tmp.
(2) tar-zxvf bind-9.2.1.tar.gz
(2) cd bind-9.2.1
(3) / configure
Make
Make install
If you install from the installation CD of RedHat Linux7.2, then:
(1) put the installation CD of RedHat Linux7.2 into the CD-ROM drive and execute:
Mount / dev/cdrom / mnt/cdrom
(2) cd / mnt/cdrom / RedHat/RPMS
(3) rpm-ivh bind-9.1.3-4.i386.rpm
2. Modify the configuration file, namely vi/etc/named.conf.
(1) define the positive solution region and insert the following in the named.conf file:
Zone "greatwall.com" {
Type master
File "dns.greatwall.com"
}
(2) define the inverse region and insert the following into the named.conf file:
Zone "98.119.202.in-addr.arpa" {
Type master
File "202.119.98"
}
3. Use the / etc/hosts file to resolve the server domain name, and insert the following in the / etc/hosts file:
202.119.98.1 ns ns.greatwall.com
4. Create a DNS database file.
(1) create a positive solution database file / var/named/dns.greatwall.com, which contains the following contents:
$TTL86400
@ IN SOA ns.greatwall.com. Root.ns.greatwall.com (
199802151; serial
28800; refresh
14400; retry
3600000; expire
86400); minimum,seconds
NS ns.greatwall.com.
Ns A 202.119.98.1
Www A 202.119.98.10
Ftp A 202.119.98.100
. . .
. . .
. . .
(2) create the anti-decoding database file / var/named/202.119.98, which contains the following contents:
$TTL86400
@ IN SOA ns.greatwall.com. Root.ns.greatwall.com (
199802151; serial
28800; refresh
14400; retry
3600000; expire
86400); minimum
IN NS ns.greatwall.com.
1 IN PTR ns.greatwall.com.
10 IN PTR www.greatwall.com.
100 IN PTR ftp.greatwall.com.
. . .
. . .
. . .
5. Start the DNS service, / etc/rc.d/init.d/named start (see example 1).
6. Test the DNS server.
(1) set / etc/resolv.conf, that is, set the DNS of a client to 202.119.98.1 (or set the DNS server to 202.119.98.1, where the server is also the client):
Nameserver 202.119.98.1
(2) execute the command dig-x 202.119.98.1 to test whether the server is normal.
(3) execute the nslookup www.greatwall.com command to resolve the internal domain name address.
(4) execute the dig greatwall.com axfr command to view all records of the uplowall.com domain.
(5) execute the nslookup www.google.com command to resolve external domain names.
This is the end of the article on "how to configure and use bind". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.