Linux_DNS服务器
2015-12-06 16:59
851 查看
目录
目录DNS
DNS Server
ServerSite
Master DNS Server
Forward Domain
Reverse Resolution
Slave DNS Server
Forward lookup
Reverse lookup
Split DNS Server
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.confopeions { # 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.zonezone "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.zonezone "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 serverstep2. Edit the named.rf1912.zones
Forward lookup:
vim /etc/named.rf1912.zoneszone "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.zoneszone "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 filevim /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.
相关文章推荐
- 【Linux编程】IO复用之select详解
- windows linux Git使用总结
- CentOS6.7系统文本安装
- 20135316王剑桥 linux第十二周课实验笔记
- 【学神-RHEL7】-1511班12月6号阶段小测试题目
- linux网卡bond的几种模式
- 完美解决 Linux 下 Sublime Text 3中文输入
- LINUX(UNIX)文件I/O学习
- Ubuntu的防火墙及SElinux
- linux 下mysql 主从数据库
- linux 分区 物理卷 逻辑卷
- Android与Linux中从uid到用户名的映射
- [Linux基础环境/软件]Linux下安装mysql
- Linux autojump命令
- linux下安装vsftp
- Linux命令-压缩解压命令
- centos配置nfs服务详细步骤(centos开启nfs服务)
- linux 信号设计 --不断补充--欢迎指正讨论
- 深入理解linux i节点
- Linux命令-权限设置