DNS with bind learning notes 1
DNS and Bind Learn Notes 2
DNS and Bind Learn Notes 3
10. What is a DNS database? What is the use? A domain DNS database is a collection of text files maintained by the system administrator of the primary name server of the domain. These text files become zone files. It is the file you defined in "named.conf". They include two types of items: Analyzer commands (such as $ Origin and $ TTL) and resource records. The resource record is a real part of the database, and the analyzer command is only some of the simple ways to enter records. Basic format of resource record: [Name] [TTL] [Class] Type Data Name field: Represents a host or a domain. I often see "@" in the configuration file, in fact, representing the domain, you can write all. Test in the experimentation experiment. TTL field: in seconds, and the TTL in the TCP / IP is almost meaningful, that is, survival time, just the TTL in the network refers to the number of hops (it seems). In Bind9, use the $ TTL instruction, and there is no such instruction. The survival time is generally set to a week, so that the network traffic and the load of the DNS can be significantly reduced. Class field: Generally use "in", the corresponding is the Internet. TYPE field: Soa, A, NS, PTR, MX, CNAME, etc., I will see these types in detail. DATA field: Difference depending on the Type field. Generally, the resource record of a zone is written in the forefront, then the NS record, and other order can be arbitrary. Below I will list some frequently used records. And combined examples. (1) SOA Record: There is only one SOA record in each zone, which has been extended to encounter another SOA record. SOA records include names, a technical contact and a variety of timeout values. The following is an example:; the name specified in the zone statement specified in Named.conf. Assumption is marco.fudan.edu @ in SOA ns.marco.fudan.edu. Admin.marco.fudan.edu. (20040701; Serial 8h; Refresh, 8 Hours 1H; Retry, 1 Hour 2w; Expire, 2 Weeks 1D) Minimum, 4 days detailed description: "@" is a short-term name of the current area name. Here you can use marco.fudan.edu. Alternative (never forget the last ".", Followed by. Its value is the name specified in the zone statement in the named.conf file; can be changed using the $ Origin Analyzer Directive in this area. There is no TTL field here. Class is of course IN. Ns.marco.fudan.edu. It is the primary name server of the area (pays back later. "Oh) admin.marco.fudan.edu. It is a domain administrator's mailbox, to put the first". " @ ", And discard the last". " Parentheses cannot be made, used to make SOA records across a few lines. However, it can be placed casually in 9. Test when doing experiment. The first value Serial represents the serial number of this area. You can get new data from the server to get new data. Here I am set up today. Updating a data file must be updated this serial number, otherwise it will not update from the server.
Remember! ! ! The second value refresh specifies how long it takes from the server to be parallel to the primary server. (Of course, there is now this parameter. Once the primary server is updated, it will immediately notify the server to update, then what is the use of this parameter? Used when the Notify parameter is closed ... 嘻嘻) The third value retry If the primary server does not respond from the server attempts to check the serial number of the primary server, it will be re-examined after this time. The fourth value expire will determine the time long-term length of the long-term continuous supply domain data service without the primary server without the primary server. It may refer to the client if the client is to resolve the IP of a server, and this server does not represent the survival time of the customer query. $ TTL, EXPIRE and MINIMUM parameters finally decided to abandon the old data values for everyone who uses DNS. (2) NS Record: Identify a server that has authoritative to a zone (ie all primary servers and slave servers), and commission the subdomain to other agencies. The format is: zone [ttl] in ns hostname, for example: marco.fudan.net. In ns ns.marco.fudan.net.
Marco.fudan.net. in ns anchor.marco.fudan.net.
Marco.fudan.net. in ns ns.marco.tj.net.
(3) a Record: It is the core of the DNS database. They provide mappings named IP addresses previously specified in the / etc / hosts file. A host must get an A record for each network interface. The format is: hostname [TTL] IN A ipaddr, for example: Anchor IN A 192.168.1.10 represents anchor.marco.fudan.net. IP is 192.168.1.10
(4) PTR Record: Reverse mapping from the IP address to the hostname. Like A record, there must be a PTR record for each network interface. First introduce in-addr.arpa: Naming of this below is similar to the IP address of the reverse byte order. For example, the area of our 243 subnet is 243.151.128.in-addr.arpa. The format is: AddR [TTL] in Ptr Hostname, for example, PTR records corresponding to the ANCHOR's A record in 243.151.128.in-addr.arpa zone: 100 in ptr auchor.marco.fudan.net.
(5) MX Record: The email system is a more efficient routing message using MX records. The format is: Name [TTL] IN MX preference Host ... For example: (1) unless the downtime does not receive mail. Here is three, when the current two are shut down, will be sent to the third. And the third must write, because he is not a member of the default domain. Yuyu In MX 10 yuyu in mx 20 Mailbox in mx 50 lpq.com. (2) Do not receive mail yuyu in mx 10 Mailbox in mx 20 Anchor in mx 50 lpq.com. Description, the middle priority is fixed, middle Separation is to insert a new host in the future without re-numbery.
(6) CNAME Record: Assign an additional name for the host. It is used to shorten a long hostname or use it to link with some function. The format is: nickname [ttl] in cname hostname When Bind encounters a CNAME record, it stops querying the nickname and switches to the real name. And note that if a host references an alias, then his A, NS, MX, etc. must use the real name. For example: Colo-GW IN A 128.138.243.25COLO IN CNAME COLO-GWWW in CName Colo, the rest, such as LOC records, SRV records, TXT records, IPv6 resource records, A6 records, DNAME records, etc. I think they can be used almost, ie If you use it, you can also use your heart, you don't use your record. Can't remember: (
11. What is the steps of updating the zone file? If you have changed a change in a district, you will do: (1) The data file on the primary server must be updated (2) You must increase the serial number (3) in the SOA record of the area to run NDC Reload, signal Notification Named Implementing these changes (4.a) If Notify is open, then the updated area data is updated from the server. (4.b) If Notify is off, you need to get new area data after you need REFRESH in the SOA record, or run NDC Reload from the server.