目录

DNS

DNS(Domain Name System,域名系统),在Internet上作为域名和IP地址映射的一个分布式数据库,能够使用户更直观、更方便的访问互联网(域名更便于记忆),而不用去记住能够被机器直接读取的IP地址。通过主机名,最终得到该主机名对应的IP地址的过程叫做域名解析(或主机名解析)。所以DNS服务器的功能既是:域名、IP映射,DNS协议运行在UDP协议之上,使用端口号53。

hostname到IPaddress映射有两种方式

1) 静态映射,每台设备上都配置主机到IP地址的映射(hosts),各设备独立维护自己的映射表,而且只供本设备使用;

2) 动态映射,建立一套域名解析系统(DNS),只在专门的DNS服务器上配置主机到IP地址的映射,网络上需要使用主机名通信的设备,首先需要到DNS服务器查询主机所对应的IP地址。

注意:在解析域名时,可以首先采用静态域名解析的方法,如果静态域名解析不成功,再采用动态域名解析的方法。可以将一些常用的域名放入静态域名解析表中,这样可以大大提高域名解析效率。

DNS Server

ServerSite

vim named.conf

    opeions {
# listen-on port 53 { 127.0.0.1; }; #Monitoring computer IP. General Comment.
# listen-on-v6 post 53 { ::1; }; #As above
directory "/etc/named"; #specify directory of store domain data coinfig file
allow-query { any; }; #specify DNSServer response network segment, 'any' mean that all network segment.
};
zone "." IN {
type hint;
file "name.ca"; #record 13 root DNSServerIP
}

Master DNS Server

step1.

yum install -y bind bind-chroot

step2. Edit the config file.

vim /etc/named.conf

        opeions {
# listen-on port 53 { 127.0.0.1; }; #monitoring computer IP, General comments.
# listen-on-v6 post 53 { ::1; }; #Idem
directory "/etc/named"; #specify directory of store domain data coinfig file
allow-query { any; }; #specify DNSServer response network segment, any mean that all network segment.
};

Forward Domain

vim /etc/name.rf1912.zone

            zone "fan.com" IN {
type master;
file "fan.com.zone"; #need create in the /var/named/fan.com.zone by manual
allow-update { none; };
};

Create zone config file:

cp -p /var/named/named.localhost /var/named/fan.com.zone

vim fan.com.zone

            @        NS    hostname.domain.   #one NS flag have to mapping one A flay
hostname A 192.168.1.144
www A 192.168.1.145
ftp A 192.168.1.146
@ MX 10 mail.fan.com.

Reverse Resolution

vim /etc/name.rf1912.zone

            zone "1.168.192.in-addr.arpa" IN {
type master;
file "192.168.1.zone";
allow-update { none; };
};

Create zone config file:

cp -p /var/named/named.localhost /var/named/192.168.1.zone

vim 192.168.1.zone

            @        NS     hostname.domain.
145 PTR www.fan.com.
146 PTR ftp.fan.com.

step3. Start named service

service named restart

Slave DNS Server

step1. Edit Slave dns server’s named.conf file same as master server

step2. Edit the named.rf1912.zones

Forward lookup:

vim /etc/named.rf1912.zones

            zone "fan.com" IN {
type slave;
masters { MasterServerIP; };
file "slaves/fan.com.zone.slave"; #in the /var/names/slaves/ directory
};

Reverse lookup:

vim /etc/named.rf1912.zones

            zone "1.168.192.in-addr.arpa" IN {
type slave;
masters { MasterServerIP; };
file "slaves/192.168.1.zone.slave";
};

step3.

service named restart

Split DNS Server

step1. Edit the DNSServer main config file

vim /etc/named.conf

#Comment the root node and line of 'include "/etc/named.rf1912.zone"'
#zone "." IN {
# type hint;
# file "named.ca";
#};
#include "/etc/named.rf1912.zone"

step2. Add view for public network and private network

Attention:First setting LAN then setting WAN .

vim /etc/named.conf

privateNetwork

        view "lan(viewName)" {
match-clients { 1992.168.1.0/24; }; #specify split uplook domain networkSepment.
zone "fan.com" IN { #define the uplook domain
type master;
file "fan.com.zone"
notify yes; #allow tthe DNSServer update
also-notify { 192.168.1.2; }; #assign to the dns slave server
};
};

publicNetwork

        view "wan" {
match-clients { any; };
zone "fan.com" IN {
type master;
file "fan.com.zone"
};
};

step3. Create the domain date file in directory with “/var/named” and restart named service.

最新文章

  1. Spring学习记录(十二)---AOP理解和基于注解配置
  2. 【完全开源】微信客户端.NET版
  3. Windows server 修改mysql端口
  4. iOS运用fabric记录crash日志过程
  5. C#下搭建文件格式转换服务器
  6. uva 111 - History Grading (dp, LCS)
  7. Render Texture的使用(截取rendertexture的一帧到Texture2D)
  8. SQL Server 事务与锁
  9. bootstrap使用中遇到的问题(二)
  10. [置顶] 从引爆点的角度看360随身wifi的发展
  11. Redis数据类型之List(三)
  12. 『最短Hamilton路径 状态压缩DP』
  13. Linux常用命令——网络命令
  14. 标准盒模型、IE盒模型
  15. Unity资源打包之Assetbundle
  16. jdk8-stream-并行流的使用
  17. java基础-网络编程(Socket)技术选型入门之NIO技术
  18. Struts2、Spring、Hibernate 高效开发的最佳实践(转载)
  19. Django 数据传递
  20. Spark案例分析

热门文章

  1. RabbitMQ交换器Exchange介绍与实践
  2. author认证模块
  3. JAVA中自定义properties文件介绍
  4. 使用Cookie记住登录用户
  5. C#基础知识之事件和委托
  6. JVM 程序计数器
  7. BOM-window
  8. Flater-Provide狀態管理
  9. man du
  10. 3分钟教会你把封装的js公共方法挂载在vue实例原型上