热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

安装DNS服务器

安装DNS服务器--Linux企业应用-Linux服务器应用信息,下面是详情阅读。
1、从www.isc.org下载bind 域名服务器软件。我们这里用的是bind8.3.0,bind8分支和bind9分支是并行发展的。根据自己的实际情况选择合适的bind版本。

2、mkdir /usr/src/bind83

3、下载的文件叫bind-src.tar.gz,复制到/usr/local/src/bind83目录下。

4、cd /usr/local/src/bind83

5、tar zxvf bind-src.tar.gz

6、cd src

7、make stdlinks

8、make clean

9、make depend

10、make all

11、make install

12、编辑配置文件:/etc/named.conf内容如下,需要更改的部分用黑体标出:

 /*
   * This is a worthless, nonrunnable example of a named.conf file that has
   * every conceivable syntax element in use. We use it to test the parser.
   * It could also be used as a conceptual template for users of new features.
   */
  /*
   * C-style comments are OK
   */
  // So are C++-style comments
  # So are shell-style comments
  // watch out for ";" -- it's important!
  options {
directory "/var/named";
      // use current directory
named-xfer "/usr/libexec/named-xfer";
      // _PATH_XFER
dump-file "named_dump.db";
      // _PATH_DUMPFILE
pid-file "/var/run/named.pid";
      // _PATH_PIDFILE
statistics-file "named.stats";
      // _PATH_STATS
memstatistics-file "named.memstats";
      // _PATH_MEMSTATS
check-names master fail;
check-names slave warn;
check-names response ignore;
host-statistics no;
deallocate-on-exit no;
      // Painstakingly deallocate all
      // objects when exiting instead of
      // letting the OS clean up for us.
      // Useful a memory leak is suspected.
// Final statistics are written to the
// memstatistics-file.
datasize default;
stacksize default;
coresize default;
files unlimited;
recursion yes;
fetch-glue yes;
fake-iquery no;
notify yes;
     // send NOTIFY messages. You can set
// notify on a zone-by-zone
// basis in the "zone" statement
// see (below)
serial-queries 4;
     // number of parallel SOA queries
// we can have outstanding for master
// zone change testing purposes
auth-nxdomain yes;
// always set AA on NXDOMAIN.
// don't set this to 'no' unless
// you know what you're doing -- older
// servers won't like it.
multiple-cnames no;
   // if yes, then a name my have more
// than one CNAME RR. This use
// is non-standard and is not
// recommended, but it is available
// because previous releases supported
// it and it was used by large sites
// for load balancing.
allow-query { any; };
allow-transfer { any; };
transfers-in 10;
     // DEFAULT_XFERS_RUNNING, cannot be
   // set > than MAX_XFERS_RUNNING (20)
transfers-per-ns 2;
// DEFAULT_XFERS_PER_NS
transfers-out 0;
// not implemented
max-transfer-time-in 120;
// MAX_XFER_TIME; the default number
// of minutes an inbound zone transfer
// may run. May be set on a per-zone
// basis.
transfer-format one-answer;
query-source address * port *;
  /*
* The "forward" option is only meaningful if you've defined
* forwarders. "first" gives the normal BIND
* forwarding behavior, i.e. ask the forwarders first, and if that
* doesn't work then do the full lookup. You can also say
* "forward only;" which is what used to be specified with
* "slave" or "options forward-only". "only" will never attempt
   * a full lookup; only the forwarders will be used.
   */
forward first;
forwarders { };
    // default is no forwarders
topology { localhost; localnets; };
    // prefer local nameservers
listen-on port 53 { any; };
    // listen for queries on port 53 on
   // any interface on the system
   // (i.e. all interfaces). The
   // "port 53" is optional; if you
   // don't specify a port, port 53
   // is assumed.
/*
* Interval Timers
*/
cleaning-interval 60;
    // clean the cache of expired RRs
   // every 'cleaning-interval' minutes
interface-interval 60;
    // scan for new or deleted interfaces
   // every 'interface-interval' minutes
statistics-interval 60;
    // log statistics every
   // 'statistics-interval' minutes
maintain-ixfr-base no;
    // If yes, keep transaction log file for IXFR
max-ixfr-log-size 20;
    // Not implemented, maximum size the
   // IXFR transaction log file to grow
  };

  /*
   * Control listeners, for "ndc". Every nameserver needs at least one.
   */
  controls {
inet * port 52 allow { any; };
// a bad idea
unix "/var/run/ndc" perm 0600 owner 0 group 0;
       // the default
  };
  zone "rd.xxx.com" in {
type master;
      // what used to be called "primary"
file "rd.xxx.com.db";
check-names fail;
allow-update { none; };
allow-transfer { any; };
allow-query { any; };
// notify yes;
      // send NOTIFY messages for this
// zone? The global option is used
// if "notify" is not specified
// here.
also-notify { };
      // don't notify any nameservers other
// than those on the NS list for this
// zone
  };

  zone "223.99.211.in-addr.arpa" in {
type master;
// what used to be called "secondary"
file "21.9.22.db";
};

  zone "0.0.127.in-addr.arpa" in {
type master;
file "127.0.0.db";
  };

  zone "." in {
type hint;
       // used to be specified w/ "cache"
file "named.root";
  };

  logging {
/*
* All log output goes to one or more "channels"; you can make as
* many of them as you want.
*/
channel syslog_errors {
      // this channel will send errors or
syslog user;
      // or worse to syslog (user facility)
severity error;
};
category parser {
syslog_errors;
// you can log to as many channels
default_syslog;
     // as you want
};
category lame-servers { null; };
     // don't log these at all
channel moderate_debug {
severity debug 3;
     // level 3 debugging to file
file "foo";
     // foo
print-time yes;
    // timestamp log entries
print-category yes;
     // print category name
print-severity yes;
     // print severity level
/*
* Note that debugging must have been turned on either
* on the command line or with a signal to get debugging
* output (non-debugging output will still be written to
* this channel).
*/
};

/*
* If you don't want to see "zone XXXX loaded" messages but do
* want to see any problems, you could do the following.
*/
channel no_info_messages {
syslog;
severity notice;
};
category load { no_info_messages; };
/*
* You can also define category "default"; it gets used when no
* "category" statement has been given for a category.
*/
category default {
default_syslog;
moderate_debug;
};

};



13、在/var/named/中生成/etc/named.conf中标记的文件:rd.xxx.com.db,内容如下,需要修改和调整相应部分:

 ;Authoriative data for rd.xxx.com
  ;
  $TTL 3600
  @ IN SOA compaq.rd.xxx.com. tandongyu.rd.xxx.com. (
    20020101 ;Serial
    3600 ;Refresh 1 hour
    900 ;Retry 15 mins
    604800 ;Expire 7 days
    86400) ;Mini 24 hours
  ;Name server NS records
  @ IN NS compaq.rd.xxx.com.
  ;Mail Exchange (MX) records
  rd.xxx.com. IN MX 0 compaq
  ;Address (A) records.
  localhost IN A 127.0.0.1
  compaq IN A 21.9.22.9
  tls65 IN A 21.9.22.8
  fbsd IN A 21.9.22.7



14、在/var/named/中生成/etc/named.conf中标记的文件:21.9.22.db,内容如下,你需要修改相应部分:

 ;
  ;
  $TTL 3600
  @ IN SOA compaq.rd.xxx.com. tandongyu.rd.xxx.com. (
    20020101 ;Serial
    3600 ;Refresh
    900 ;Retry 15 mins
    604800 ;Expire 7 days
    86400) ;Mini 24 hours
  ;NameServer (NS) records
  @ IN NS compaq.rd.xxx.com.
  ;Address Point to Name (PTR) records
  9 IN PTR compaq.rd.xxx.com.
  8 IN PTR tls65.rd.xxx.com.
  7 IN PTR fbsd.rd.xxx.com.



15、在/var/named/中生成/etc/named.conf中标记的文件:127.0.0.db,内容如下,你需要修改相应部分:

  ; 0.0.127.in-addr.arpa
  $TTL 3600
  @ IN SOA compaq.rd.xxx.com. tandongyu.rd.xxx.com. (
     20020101;serial
3600 ;refresh
1800 ;retry
604800 ;expiration
3600 ) ;minimum
IN NS compaq.rd.xxx.com.
  1 IN PTR localhost.



16、在/var/named/中生成/etc/named.conf中标记的文件:named.root,内容大致如下。该文件标记了14个域名服务器。可以从ftp.rs.internic.net获得该文件的最新样本:named.hosts,然后改名成你需要  ; This file holds the information on root name servers needed to
  ; initialize cache of Internet domain name servers
  ; (e.g. reference this file in the "cache . "
  ; configuration file of BIND domain name servers).
  ;
  ; This file is made available by InterNIC registration services
  ; under anonymous FTP as
  ; file /domain/named.root
  ; on server FTP.RS.INTERNIC.NET
  ; -OR- under Gopher at RS.INTERNIC.NET
  ; under menu InterNIC Registration Services (NSI)
  ; submenu InterNIC Registration Archives
  ; file named.root
  ;
  ; last update: Aug 22, 1997
  ; related version of root zone: 1997082200
  ;
  ;
  ; formerly NS.INTERNIC.NET
  ;
    . 3600000 IN NS A.ROOT-SERVERS.NET.
    A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4
  ;
  ; formerly NS1.ISI.EDU
  ;
    . 3600000 NS B.ROOT-SERVERS.NET.
    B.ROOT-SERVERS.NET. 3600000 A 128.9.0.107
  ;
  ; formerly C.PSI.NET
  ;
    . 3600000 NS C.ROOT-SERVERS.NET.
    C.ROOT-SERVERS.NET. 3600000 A 192.33.4.12
  ;
  ; formerly TERP.UMD.EDU
  ;
    . 3600000 NS D.ROOT-SERVERS.NET.
    D.ROOT-SERVERS.NET. 3600000 A 128.8.10.90
  ;
  ; formerly NS.NASA.GOV
  ;
    . 3600000 NS E.ROOT-SERVERS.NET.
    E.ROOT-SERVERS.NET. 3600000 A 192.203.230.10
  ;
  ; formerly NS.ISC.ORG
  ;
    . 3600000 NS F.ROOT-SERVERS.NET.
    F.ROOT-SERVERS.NET. 3600000 A 192.5.5.241
  ;
  ; formerly NS.NIC.DDN.MIL
  ;
    . 3600000 NS G.ROOT-SERVERS.NET.
    G.ROOT-SERVERS.NET. 3600000 A 192.112.36.4
  ;
  ; formerly AOS.ARL.ARMY.MIL
  ;
    . 3600000 NS H.ROOT-SERVERS.NET.
    H.ROOT-SERVERS.NET. 3600000 A 128.63.2.53
  ;
  ; formerly NIC.NORDU.NET
  ;
    . 3600000 NS I.ROOT-SERVERS.NET.
    I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17
  ;
  ; temporarily housed at NSI (InterNIC)
  ;
    . 3600000 NS J.ROOT-SERVERS.NET.
    J.ROOT-SERVERS.NET. 3600000 A 198.41.0.10
  ;
  ; housed in LINX, operated by RIPE NCC
  ;
    . 3600000 NS K.ROOT-SERVERS.NET.
    K.ROOT-SERVERS.NET. 3600000 A 193.0.14.129
  ;
  ; temporarily housed at ISI (IANA)
  ;
    . 3600000 NS L.ROOT-SERVERS.NET.
    L.ROOT-SERVERS.NET. 3600000 A 198.32.64.12
  ;
  ; housed in Japan, operated by WIDE
  ;
    . 3600000 NS M.ROOT-SERVERS.NET.
    M.ROOT-SERVERS.NET. 3600000 A 202.12.27.33
  ; End of File

17、我们还需要配置/etc/resolv.conf、/etc/hosts、/etc/hosts.conf文件以适应新的状况。

18、一切都结束后,用/usr/sbin/ndc start命令启动bind,同样的可用stop、restart、reload等命令参数操作。

19、启动后用nslookup命令(有的系统推荐使用dig命令)检验是否正确。如果出现错误,该命令将不能启动。一般的错误都是数据库文件或配置文件笔误所至。比如少个“.”或者文件明不正确等等。
推荐阅读
  • 一、Hadoop来历Hadoop的思想来源于Google在做搜索引擎的时候出现一个很大的问题就是这么多网页我如何才能以最快的速度来搜索到,由于这个问题Google发明 ... [详细]
  • [译]技术公司十年经验的职场生涯回顾
    本文是一位在技术公司工作十年的职场人士对自己职业生涯的总结回顾。她的职业规划与众不同,令人深思又有趣。其中涉及到的内容有机器学习、创新创业以及引用了女性主义者在TED演讲中的部分讲义。文章表达了对职业生涯的愿望和希望,认为人类有能力不断改善自己。 ... [详细]
  • 本文介绍了在Win10上安装WinPythonHadoop的详细步骤,包括安装Python环境、安装JDK8、安装pyspark、安装Hadoop和Spark、设置环境变量、下载winutils.exe等。同时提醒注意Hadoop版本与pyspark版本的一致性,并建议重启电脑以确保安装成功。 ... [详细]
  • 本文介绍了Hyperledger Fabric外部链码构建与运行的相关知识,包括在Hyperledger Fabric 2.0版本之前链码构建和运行的困难性,外部构建模式的实现原理以及外部构建和运行API的使用方法。通过本文的介绍,读者可以了解到如何利用外部构建和运行的方式来实现链码的构建和运行,并且不再受限于特定的语言和部署环境。 ... [详细]
  • 本文介绍了在rhel5.5操作系统下搭建网关+LAMP+postfix+dhcp的步骤和配置方法。通过配置dhcp自动分配ip、实现外网访问公司网站、内网收发邮件、内网上网以及SNAT转换等功能。详细介绍了安装dhcp和配置相关文件的步骤,并提供了相关的命令和配置示例。 ... [详细]
  • Android Studio Bumblebee | 2021.1.1(大黄蜂版本使用介绍)
    本文介绍了Android Studio Bumblebee | 2021.1.1(大黄蜂版本)的使用方法和相关知识,包括Gradle的介绍、设备管理器的配置、无线调试、新版本问题等内容。同时还提供了更新版本的下载地址和启动页面截图。 ... [详细]
  • 知识图谱——机器大脑中的知识库
    本文介绍了知识图谱在机器大脑中的应用,以及搜索引擎在知识图谱方面的发展。以谷歌知识图谱为例,说明了知识图谱的智能化特点。通过搜索引擎用户可以获取更加智能化的答案,如搜索关键词"Marie Curie",会得到居里夫人的详细信息以及与之相关的历史人物。知识图谱的出现引起了搜索引擎行业的变革,不仅美国的微软必应,中国的百度、搜狗等搜索引擎公司也纷纷推出了自己的知识图谱。 ... [详细]
  • 本文介绍了Python版Protobuf的安装和使用方法,包括版本选择、编译配置、示例代码等内容。通过学习本教程,您将了解如何在Python中使用Protobuf进行数据序列化和反序列化操作,以及相关的注意事项和技巧。 ... [详细]
  • MACElasticsearch安装步骤及验证方法
    本文介绍了MACElasticsearch的安装步骤,包括下载ZIP文件、解压到安装目录、启动服务,并提供了验证启动是否成功的方法。同时,还介绍了安装elasticsearch-head插件的方法,以便于进行查询操作。 ... [详细]
  • ZSI.generate.Wsdl2PythonError: unsupported local simpleType restriction ... [详细]
  • 本文介绍了Perl的测试框架Test::Base,它是一个数据驱动的测试框架,可以自动进行单元测试,省去手工编写测试程序的麻烦。与Test::More完全兼容,使用方法简单。以plural函数为例,展示了Test::Base的使用方法。 ... [详细]
  • 推荐系统遇上深度学习(十七)详解推荐系统中的常用评测指标
    原创:石晓文小小挖掘机2018-06-18笔者是一个痴迷于挖掘数据中的价值的学习人,希望在平日的工作学习中,挖掘数据的价值, ... [详细]
  • 本文详细介绍了在ASP.NET中获取插入记录的ID的几种方法,包括使用SCOPE_IDENTITY()和IDENT_CURRENT()函数,以及通过ExecuteReader方法执行SQL语句获取ID的步骤。同时,还提供了使用这些方法的示例代码和注意事项。对于需要获取表中最后一个插入操作所产生的ID或马上使用刚插入的新记录ID的开发者来说,本文提供了一些有用的技巧和建议。 ... [详细]
  • HDFS2.x新特性
    一、集群间数据拷贝scp实现两个远程主机之间的文件复制scp-rhello.txtroothadoop103:useratguiguhello.txt推pushscp-rr ... [详细]
  • 仙贝旅行是日本最大的旅游服务平台之一,为广大用户提供优质的日本定制游服务。随着用户数量的增长,仙贝旅行决定与智齿科技合作,全面替换原有客服系统,打造全新的在线客服体系。该体系具备多渠道快速接入的能力,让仙贝旅行轻松与各个渠道的接入用户完成沟通。同时,机器人与人工协同发力,提升客户服务水平。 ... [详细]
author-avatar
落陌_漾吇
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有