当前位置:网站首页>Detailed explanation of common DNS resource record types
Detailed explanation of common DNS resource record types
2022-08-04 23:44:00 【China Science and Technology Tripartite】
The vast majority of Internet access is based on domain names,Internet access is based on IP来实现的,因此,There needs to be a way to resolve domain names into IP的机制,Let users use the domain name to access,Automatically convert the domain name to the corresponding oneIP,这就是DNS的功能.
DNS的基础概念
DNS:Domain Name Service,基于C/S模式的域名解析服务,应用层协议;监听在53/udp,53/tcp端口;TCP用来区域传送; UDP用来解析.
区域(zone)和域(domain)
Region is a physical concept,Domains are logical concepts.
比如:sfn.cn.这个域
FQDN–>IP:
The forward parsing library and the functionality of forward parsing,It is a forward analytical area.
IP–>FQDN:
Reverse parsing library and reverse parsing functionality,It is a reverse parsing area.
一般而言,A domain is divided into a forward resolution area and a reverse resolution area,But pure domains are not necessarily larger than regions,Because of the area of the parent domain,Possibly larger than the subdomain's domain.
区域数据库文件
Primarily documented by resources(RR,resource record)组成.
Common resource record types:SOA、NS、MX、A、AAAA、PTR、CNAME.
SOA:start of authority,起始授权记录,一个区域解析库有且只能有一个SOA记录,And must be placed in the first item of all resource records.
NS:name service,域名服务记录,A zone resolution library can have more than oneNS记录,一个NSThe record represents oneDNS服务器,One of the main ones,The rest are supplementary.
MX:mail exchanger,邮件交换器,A record that identifies the address of the mail server within the domain,MX记录可以有多个,其MX记录有优先级的概念,优先级 0-99,数字越小,优先级越高.
A:address,地址记录,也就是从FQDN–>IPv4
AAAA:address,地址记录,从FQDN–>IPv6
PTR:pointer,主要用于实现IP–>FQDN
CNAME:别名记录.
The definition format of the resource record
语法:NAME [TTL] IN RR_TYPE VALUE
SOA记录:
NAME:当前区域的名字,例如:sfn.cn. Or if it's a reverse zone,则 1.168.192.in-addr.arpa.
VALUE:有多部分组成
<1>当前区域的区域名称(也可以使用主DNS服务器名称);
<2>当前区域的管理员的邮箱地址,但地址中不能使用@符号,General use of dots.来替代;
<3>The definition of the coordination properties of the master-slave service and the cache time of negative answers,Use the entire content()括号括起来,Available after each line of content;A semicolon indicates that the following are comments.
完整的SOAExample record definition:
sfn.cn. 86400 IN SOA sfn.cn. admin.sfn.cn (
2016091801 //代表序列号,不能超过10位
2H //Represents the refresh interval for synchronizing data from the slave to the master,此处表示2小时
10M //Indicates when the primary server cannot be contacted,The interval between when the slave server contacts the master server again,10分钟
1W //表示过期时间,That is, the maximum waiting time when the server is always unable to contact the main server,That is, after this time,It is determined that the primary server is faulty,Then the slave server also stops the service,1周
1D //Indicates how long to cache negative answers,1天
)
NS记录:
可有多个NS记录,一个NS记录对应一个DNS服务器,每个NSThe record should have a correspondingA记录.
NAME:当前区域的区域名称
VALUE:当前区域的某DNS服务器的名字,例如ns1.sfn.cn
例如:
sfn.cn. 86400 IN NS ns1.sfn.cn.
sfn.cn. 86400 IN NS ns2.sfn.cn.
MX记录:
MX记录可以有多个,一个MXThe record corresponds to a mail server,每个记录的VALUE之前应该有一个数字,Used to indicate its priority,数字越小,优先级越高.每个MXThe record should have a correspondingA记录.
NAME:当前区域的区域名称
VALUE:The hostname of a mail server in the current region
例如:
sfn.cn. IN MX 5 mail1.sfn.cn.
sfn.cn. IN MX 20 mail2.sfn.cn.
A记录:
FQDN–>IPv4
NAME:某FQDN,如:web.sfn.cn.
VALUE:某IPv4地址
例如:
web.sfn.cn. IN A 1.1.1.1
web.sfn.cn. IN A 1.1.1.2
bbs.sfn.cn. IN A 1.1.1.2
There can be more than one host quotaIP,一个IPThere can also be multiple hostnames
*.sfn.cn. IN A 10.1.32.1
Indicates that everything that is not previously defined separately will be parsed10.1.32.1
sfn.cn. IN A 10.1.32.1
Indicates when the user accesses the domain name without any characters before it,That is, direct accesssfn.cn.The address resolved to is 10.1.32.1
G E N E R A T E 1 − 254 s e r v e r GENERATE 1-254 server GENERATE1−254server IN A 1.1.1.$
表示将server1.sfn.cn. 解析的地址为1.1.1.1
server2.sfn.cn. 解析的地址为1.1.1.2
server3.sfn.cn. 解析为1.1.1.3
….
server254.sfn.cn. 解析为1.1.1.254
同理:
G E N E R A T E 5 − 20 t e s t GENERATE 5-20 test GENERATE5−20test IN A 1.1.1.2$
表示将test5.sfn.cn. 解析的地址为1.1.1.25
test6.sfn.cn. 解析的地址为1.1.1.26
test7.sfn.cn. 解析为1.1.1.27
….
test20.sfn.cn. 解析为1.1.1.220
AAAA记录:
FQDN–>IPv6地址,定义方式与A记录类似
PTR记录:
反向解析记录
NAME:IP地址,有特定格式,IP反过来写,And to add a specific suffix,如:192.168.1.2The records should be written2.1.168.192.in-addr.arpa.
VALUE:为FQDN
例如:
2.1.168.192.in-addr.arpa. IN PTR bbs.sfn.cn.
CNAME记录:
别名记录
FQDN格式的别名;
VALUE:FQDNThe formal name of the format
例如:
web.sfn.cn. IN CNAME www.sfn.cn.
表示web.sfn.cn.是www.sfn.cn.的别名
注意:
<1>TTLValues can be inherited from the global,It is not necessary to define each record individually
<2>@Can be used to indicate the name of the current region
<3>two adjacent records,其NAME相同时,The latter recordNAME可以省略
<4>任何MX、NSand other types of recordsvalue为一个FQDN,此FQDN应该有一个A记录
边栏推荐
- Privacy Computing Overview
- Security software Avast and Symantec NortonLifeLock merge with UK approval, market value soars 43%
- 3年,从3K涨薪到20k?真是麻雀啄了牛屁股 — 雀食牛逼呀
- golang 协程的实现原理
- [Cultivation of internal skills of memory operation functions] memcpy + memmove + memcmp + memset (4)
- @Async注解的作用以及如何实现异步监听机制
- 使用OpenCV实现一个文档自动扫描仪
- Service Mesh landing path
- MySQL增删改查基础
- PID Controller Improvement Notes No. 7: Improve the anti-overshoot setting of the PID controller
猜你喜欢
从单体架构迁移到 CQRS 后,我觉得 DDD 并不可怕
隐私计算综述
uniapp 分享功能-分享给朋友群聊朋友圈效果(整理)
加解密在线工具和进制转化在线工具
Since a new byte of 20K came out, I have seen what the ceiling is
407. 接雨水 II
统计单词(DAY 101)华中科技大学考研机试题
NebulaGraph v3.2.0 Release Note,对查询最短路径的性能等多处优化
Bidding Announcement | Operation and Maintenance Project of Haina Baichuang Official Account
SQL association table update
随机推荐
应用联合、体系化推进。集团型化工企业数字化转型路径
uniapp horizontal tab (horizontal scrolling navigation bar) effect demo (organization)
what is MVCC
typeScript-promise
【CVA估值训练营】财务建模指南——第一讲
未上市就“一举成名”,空间媲美途昂,安全、舒适一个不落
对“为什么一些程序员很傲慢”的解读
uniapp 分享功能-分享给朋友群聊朋友圈效果(整理)
深度|医疗行业勒索病毒防治解决方案
入门3D游戏建模师知识必备
Implementing class target method exception using proxy object execution
话题 | 雾计算和边缘计算有什么区别?
TypeScript - the use of closure functions
情人节---快来学习一下程序员的专属浪漫吧
2022年华数杯数学建模
使用OpenCV实现一个文档自动扫描仪
一点点读懂cpufreq(二)
Mathematical Principles of Matrix
PID Controller Improvement Notes No. 7: Improve the anti-overshoot setting of the PID controller
七牛云图片上传