Linux操作系统下配置DNS服务器的方法介绍

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

Linux操作系统下配置DNS服务器的方法介绍有两台邮件服务器分别为192.168.1.1(windows下主机名为b.test.cn)和192.168.1.3(linux下主机名为a.test.com)。在linux下配置DNS服务器,下面是配置过程中设置过的一些文件,/etc/hosts文件的具体内容如下:#Donotremovethefollowingline,orvariousprograms#thatrequirenetworkfunctionalitywillfail.127.0.0.1localhost.localdomainlocalhostfc4192.168.1.3a.test.coma192.168.1.1b.test.cnb/etc/host.conf文件:orderhosts,bind表示先用hosts文件做解析,在用DNS解析/etc/resolv.conf文件:;generatedbyNetworkManager,donotedit!searchtest.comnameserver127.0.0.1searchtest.cnnameserver192.168.1.1nameserver61.144.56.100/etc/named.conf文件:////named.confforRedHatcaching-nameserver//options{directory/var/named;dump-file/var/named/data/cache_dump.db;statistics-file/var/named/data/named_stats.txt;/**Ifthereisafirewallbetweenyouandnameserversyouwant*totalkto,youmightneedtouncommentthequery-source*directivebelow.PreviousversionsofBINDalwaysasked*questionsusingport53,butBIND8.1usesanunprivileged*portbydefault.*///query-sourceaddress*port53;};////acachingonlynameserverconfig//controls{inet127.0.0.1allow{localhost;}keys{rndckey;};};zone.IN{typehint;filenamed.ca;};zonetest.comIN{typemaster;filetest.com;allow-update{none;};};zone1.168.192.in-addr.arpaIN{typemaster;file192.168.1.rev;allow-update{none;};};zonetest.cnIN{typemaster;filetest.cn;allow-update{none;};};zone0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpaIN{typemaster;filenamed.ip6.local;allow-update{none;};};zone255.in-addr.arpaIN{typemaster;filenamed.broadcast;allow-update{none;};};zone0.in-addr.arpaIN{typemaster;filenamed.zero;allow-update{none;};};include/etc/rndc.key;在/var/name/test.com文件下:$TTL86400@INSOAa.test.com.root.a.test.com(42;serial(d.adams)3H;refresh15M;retry1W;expiry1D);minimumINNSa.test.com.INMX10mail.test.com.aINA192.168.1.3mailINA192.168.1.3//其中root.a.test.com的含义是管理员的邮箱/var/name/test.cn文件下:$TTL86400@INSOAb.test.cn.root.a.test.com(42;serial(d.adams)3H;refresh15M;retry1W;expiry1D);minimumINNSb.test.cn.INMX10mail.test.cn.bINA192.168.1.1mailINA192.168.1.1/var/name/192.168.1.rev文件下:$TTL86400@INSOA1.168.192.in-addr.arpa.root.test.com.(1997022700;Serial28800;Refresh14400;Retry3600000;Expire86400);MinimumINNSa.test.com.INNSb.test.cn.INMX10mail.test.com.INMX10mail.test.cn.3INPTRa.test.com.3INPTRmail.test.com.1INPTRb.test.cn.1INPTRmail.test.cn.然后用/etc/init.d/namedrestart重启DNS服务,在重启过程中,我曾经出现过好几次的错误,按照出错的提示,会提示是named.conf文件第几行出错的。或者提示在那些包含文件例如test.cn这些文件里面的问题,然后一个一个排除。最后还有一些nslookup的命令比较有用:setall用于显示使用nslookup工具这台机器上的DNS服务器的一些信息settype=any会显示完整信息包括域中邮件服务器和主从DNS服务器的名字和IP地址

1 / 7
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功