DNS and BIND基本概念梳理

DNS and BIND
    C/S:
        client:发起应用请求的程序
        server:响应请求(提供服务)的程序
            LISTEN:Socket
    DNS:传输层协议
        C/S
            UDP 53
            TCP 53
        DNS查询类型:
            递归查询:
            迭代查询:
        DNS名称查询方式:
            名称-->IP:正向解析
            IP-->名称:反向解析
                解析过程:(www.baidu.com)
                客户机---(递归)--->本地DNS服务器------>根域.------>.com------>baidu.com
                客户机域名请求解析顺序:
                    客户机--->本地hosts文件--->本地dns服务器-->...
                服务器对域名请求的处理顺序
                    DNS缓存--->本地区域解析文件--->转发器--->根域
        按查询内容分:
            正向解析:已知域名,解析地址
            反向解析:已知地址,解析域名
        域名解析记录类型:
            SOA记录:起始授权记录
            A记录:正向解析记录
            CNAME记录:别名
            PTR记录:反向解析记录
            MX记录:邮件交换记录
            NS记录:域名服务器解析记录
                优先级:0-99,数字越小越优
            资源记录的定义格式:      
                name   [TTL]   IN   RR_TYPE   value
                SOA:
                    name:当前区域的名字
                    value :有多部分组成
                        (1)当前区域的区域名称(也可以使用主DN5服务器名称)
                        (2)当前区域管理员的邮箱地址;但地址中不能使用@符号,一般使用点号来替代
                        (3)(主从服务协调属性的定义以及否定答案的TTL)
                NS:
                    name:当前区域的区域名称
                    value :当前区域的某DNS服务器的名字
                    注意: 一个区域可以有多个ns记录
                MX :
                    name:当前区域的区域名称
                    value :当前区域某邮件交换器的主机名
                    注意: MX记录可以有多个,但每个记录的value之前应该有一个数字表示其优先级
                A:
                    name :某FQDN,例如www.magedu.com
                    value :某IPv4地址
                AAAA:
                    name : FQDN
                    value: IPv6
                PTR :
                    name : IP地址,有特定格式,IP反过来写而且加特定后缀
                    value : FQND

                CNAME :
                    name : FQDN格式的别名
                    value : FQDN格式的正式名字
            注意:
                (1)TTL可以从全局维承
                (2)@表示当前区域的名称
                (3)相邻的两条记录其name相同时,后面的可省略
                (4)对于正向区域来说各MX,NS等类型的记录的value为FQDN。此FQDN应该有一个A记录
        DNS服务器分类:
            主要名称服务器
            辅助名称服务器
            根名称服务器
            高速缓存名称服务器
    BIND的安装与配置:
        BIND是DNS协议的实现,包含对域名查询和响应的所需的所有软件
        yum info 软件包 :查询相关的软件包信息
        named:bind程序运行的进程名
        程序包:
            bind-libs:被bind和bind-utls包中的程序共同用到的库文件
            bind-utls:bind客户端程序集。例如dig,host, nslookup等
            bind :提供的dns server程序、以及几个常用的测试程序
            bind-chroot:选装,让bind程序(named进程)运行于jail进程之下
        bind:
            主配置文件:/etc/named.conf,或包含其他文件
            解析库文件:/var/named目录下,一般为ZONE_NAME.zone
            注意:
                (1)-台DNS服务器可同时为多个区域提供解析
                (2)必须要有根区域解析库文件: named.ca
                (3)还应该有两个区域解析库文件: localhost和127.0.0.1的正反向解析库
                    正向: named.localhost
                    反向: named.loopback    
            rndc :953/TCP ,但默认监听于127.0.0.1地址,因此仅允许本地使用
            bind程序安装完成之后,默认即可做缓存名称服务器使用;如果没有专门负责解析的区域.直接即可启动服务
                systemctl start named.service
            主配置文件格式:
                全局配置段:
                    options{...}
                日志配置段:
                    logging{...}
                区域配置段:
                    zone{...}
                    注意:每一个配置必须以分号结尾,否则语法错误
                缓存名称服务器的配置:
                    监听能与外部主机通信的地址:...
                        学习时建议关闭dnssec
                配置文件的语法检查:
                    named-checkconf
                测试工具:
                    dig、host、nslookup等
                    dig -t A www.baidu.com:查看baidu的A记录
                    host -t NS www.baidu.com
                    nslookup进入交互模式
                    rndc命令:
                        rndc status:查看当前DNS服务器的状态
                        rndc flush:清空当前DNS服务器上的所有缓存
 

  • 11
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
Pro DNS and BIND guides you through the challenging array of features surrounding DNS, with a special focus on BIND, the worlds most popular DNS implementation. This book unravels the mysteries of DNS, offering insight into origins, evolution, and key concepts like domain names and zone files. This book focuses on running DNS systems based on BIND 9.3.0the first stable release that includes support for the latest DNSSEC (DNSSEC.bis) standards and a major functional upgrade from previous BIND 9 releases. If you administer a DNS system or are thinking about running one, or if you need to upgrade to support IPv6 DNS, need to secure a DNS for zone transfer, dynamic update, or other reasons, or if you need to implement DNSSEC, or simply want to understand the DNS system, then this book provides you with a single point of reference. Pro DNS and BIND starts with simple concepts, then moves on to full security-aware DNSSEC configurations. Various features, parameters, and resource records are described and, in the majority of cases, illustrated with one or more examples. The book contains a complete reference to zone files, Resource Records, and BINDs configuration file parameters. You can treat the book as as a simple paint-by-numbers guide to everything from a simple caching DNS, to the most complex secure DNS (DNSSEC) implementation. Background information is still included for when you need to know what to do and why you have to do it, and so that you can modify processes to meet your unique needs.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值