CentOS DNS简单配置

Standard

yum install bind bind-utils bind-libs

vi /etc/named.conf

options {
  directory "/etc";
  pid-file "/var/run/named/named.pid";
};
zone "."{
  type hint;
  file "/var/named/named.ca";
};
zone "localhost"{
  type master;
  file "/var/named/localhost.zone";
};
zone "0.0.127.in-addr.arpa"{
  type master;
  file "/var/named/localhost.rev";
};
zone "yemaosheng.com" {
  type master;
  file "/var/named/yemaosheng.com.zone";
};
zone "1.168.192.in-addr.arpa" {
  type master;
  file "/var/named/yemaosheng.com.rev";
};

vi /var/named/localhost.zone

$TTL    86400
@   IN   SOA   localhost. root.localhost. (
  42 ; serial (d. adams)
  3H ; refresh
  15M ; retry
  1W ; expiry
  1D ; ) minimum
IN NS           localhost.
IN A            127.0.0.1

vi /var/named/localhost.rev

$TTL   86400
@   IN   SOA   localhost. root.localhost. (
  1
  28800
  14400
  3600000
  86400
)
IN   NS   localhost.
1   IN   PTR   localhost.

vi /var/named/yemaosheng.com.zone

$TTL   86400
@   IN   SOA   ns.yemaosheng.com. root.localhost. (
  1
  28800
  14400
 3600000
  86400
)
IN   NS   ns.yemaosheng.com.
ns.test.com   IN   MX   10   ns.yemaosheng.com.  ;指定邮件交换记录
ns                IN   A           192.168.1.123

vi /var/named/yemaosheng.com.rev

$TTL   86400
@   IN   SOA   ns.yemaosheng.com. root.localhost. (
  1
  28800
  14400
  3600000
  86400
)
IN     NS          ns.yemaosheng.com.
123   IN   PTR   ns.yemaosheng.com. ;反向解析IP地址

4 thoughts on “CentOS DNS简单配置

  1. luojun

    学习学习,,centos 为什么要用yum更新呢
    directory “/etc”;
    pid-file “/var/run/named/named.pid”;
    还把路径都写上?企4.0
    就不用啊 有区别吗?
    122089873
    我的qq

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.