Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

13.2.1 Positive analysis experiment


May 24, 2021 That's what Linux should learn



In DNS domain name resolution service, positive resolution refers to finding the corresponding IP address based on the domain name (host name). T hat is, when the user enters a domain name, the bind service program automatically looks for it and returns the matching IP address to the user. This is also the most commonly used DNS operating mode.

Step 1: Edit the zone profile. B y default, some irrelevant resolution parameters are already relevant in the file, designed to give the user a reference. We can add the following parameters to the bottom of the zone profile, or, of course, we can empty all the original information in the file and keep only our own domain name resolution information:

[root@linuxprobe ~]# vim /etc/named.rfc1912.zones zone "linuxprobe.com" IN { type master; f ile "linuxprobe.com.zone"; a llow-update {none; } ; } ; S tep 2: Edit the data profile. W e can copy a positively resolved template file (named.localhost) from the /var/named directory, and then fill in the data profile for the domain name and IP address and save it. Remember to add the -a parameter when copying, which preserves information such as the owner of the original file, the group to which it belongs, permission properties, and so on, so that the bind service program can read the contents of the file smoothly:

[root@linuxprobe ~]# cd /var/named/ [root@linuxprobe named]# ls -al named.localhost -rw-r-----. 1 root named 152 Jun 21 2007 named.localhost (root@linuxprobe named) s cp -a named.localhost linuxprobe.com.zone edit data profile. A fter saving and exiting the file, remember to restart the named service program for the new parsed data to take effect. Considering that there are more parameters in the positive resolution file and they are relatively important, Mr. Liu made a brief explanation after each parameter.

The root @ Linuxprobe name named, the vim linuxprobe.com.zone, root @ Linuxprobe the name, the systemctl restart named $ TTL 1D # survival cycle is 1 day
@ IN SOA linuxprobe.com. r oot.linuxprobe.com. (

Authorization Information Starts: #dns area address # Domin administrator's mailbox (Don't use the symbol)

  1. 0;serial #更新序列号
  2. 1D;refresh #更新时间
  3. 1H;retry #重试延时
  4. 1W;expire #失效时间
  5. 3H;)minimum #无效解析记录的缓存时间
  6. NS ns.linuxprobe.com. #域名服务器记录
  7. ns IN A 192.168.10.10 #地址记录(ns.linuxprobe.com.)
  8. IN MX 10 mail.linuxprobe.com. #邮箱交换记录
  9. mail IN A 192.168.10.10 #地址记录(mail.linuxprobe.com.)
  10. www IN A 192.168.10.10 #地址记录(www.linuxprobe.com.)
  11. bbs IN A 192.168.10.20 #地址记录(bbs.linuxprobe.com.)

Step 3: Test the results of the analysis. I n order to verify the resolution results, we must first modify the DNS address parameters in the Linux system network card to modify the cost machine IP address, so that we can use the DNS query service provided by the machine. The nslookup command is used to detect the ability to query the resolution records of domain names and IP addresses from DNS servers, thus more accurately verifying that DNS servers are already able to provide services to users.

[root@linuxprobe ~]# systemctl restart network [root@linuxprobe ~]# nslookup

www.linuxprobe.com Server: 127.0.0.1 Address: 127.0.0.1#53 Name: www.linuxprobe.com Address: 192.168.10.10 bbs.linuxprobe.com Server: 127.0.0.1 Address: 127.0.0.1#53 Name: bbs.linuxprobe.com Address: 192.168.10.20