目录

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.

Linux_DNS服务器的更多相关文章

  1. linux服务器wget无法成功解析域名及程序获取外网数据不稳定问题

    1.问题描述: 1.1 最近发现通过linux服务器wget下载远程文件经常提示无法解析域名问题,要重复多次才能成功,成功率比较低. 1.2 PHP用file_get_contents()函数获取淘宝 ...

  2. App开发:模拟服务器数据接口 - MockApi

    为了方便app开发过程中,不受服务器接口的限制,便于客户端功能的快速测试,可以在客户端实现一个模拟服务器数据接口的MockApi模块.本篇文章就尝试为使用gradle的android项目设计实现Moc ...

  3. 闰秒导致MySQL服务器的CPU sys过高

    今天,有个哥们碰到一个问题,他有一个从库,只要是启动MySQL,CPU使用率就非常高,其中sys占比也比较高,具体可见下图. 注意:他的生产环境是物理机,单个CPU,4个Core. 于是,他抓取了CP ...

  4. 闲来无聊,研究一下Web服务器 的源程序

    web服务器是如何工作的 1989年的夏天,蒂姆.博纳斯-李开发了世界上第一个web服务器和web客户机.这个浏览器程序是一个简单的电话号码查询软件.最初的web服务器程序就是一个利用浏览器和web服 ...

  5. SignalR系列续集[系列8:SignalR的性能监测与服务器的负载测试]

    目录 SignalR系列目录 前言 也是好久没写博客了,近期确实很忙,嗯..几个项目..头要炸..今天忙里偷闲.继续我们的小系列.. 先谢谢大家的支持.. 我们来聊聊SignalR的性能监测与服务器的 ...

  6. 使用 Nodejs 搭建简单的Web服务器

    使用Nodejs搭建Web服务器是学习Node.js比较全面的入门教程,因为要完成一个简单的Web服务器,你需要学习Nodejs中几个比较重要的模块,比如:http协议模块.文件系统.url解析模块. ...

  7. 通过ProGet搭建一个内部的Nuget服务器

    .NET Core项目完全使用Nuget 管理组件之间的依赖关系,Nuget已经成为.NET 生态系统中不可或缺的一个组件,从项目角度,将项目中各种组件的引用统统交给NuGet,添加组件/删除组件/以 ...

  8. 谈谈如何使用Netty开发实现高性能的RPC服务器

    RPC(Remote Procedure Call Protocol)远程过程调用协议,它是一种通过网络,从远程计算机程序上请求服务,而不必了解底层网络技术的协议.说的再直白一点,就是客户端在不必知道 ...

  9. 游戏服务器菜鸟之C#初探一游戏服务

    本人80后程序猿一枚,原来搞过C++/Java/C#,因为工作原因最后选择一直从事C#开发,因为读书时候对游戏一直比较感兴趣,机缘巧合公司做一个手游的项目,我就开始游戏服务器的折腾之旅. 游戏的构架是 ...

随机推荐

  1. win 10 自带 Ubuntu 系统的文件位置

    win 10 自带 Ubuntu 系统的文件位置 Ubuntu 作为最为流行 Linux 系统中的一种,是用来学习 Linux 相关知识是最好不过的选择.专门搞一个 Ubuntu 系统的电脑不太现实, ...

  2. 四:JVM调优原理与常见异常处理方案

    在jvm调优之前,我们必须先了解jvm的内存模型与GC回收机制,这些在我前面的文章里面有介绍!接下来我们通过一个案例来调整jvm性能. 一测试案例: 1.1 编写demo import java.te ...

  3. [UWP]CompositionLinearGradientBrush加BlendEffect,双倍的快乐

    原文:[UWP]CompositionLinearGradientBrush加BlendEffect,双倍的快乐 1. 什么是BlendEffect# 上一篇文章介绍了CompositionLinea ...

  4. wordpress添加index页面跳转链接

    1. 制作page页面 1.1 在themes下的主题目录新建一个page页面 1.2 在wordpress后台新建页面跟在目录页面中相同名字的页面文件 1.3 复制后台页面中的古定链接 1.4 在i ...

  5. Jmeter--函数助手之随机函数_Random(随机函数)

    各函数调用方法如下:1)__Random( , , ),获取值的方式:${__Random( param1,param2 ,param3 )},param1为随机数的下限,param2为随机数的上限, ...

  6. VS 2012 Unit Test

    1,Open Tool->Custmoize 2,Create Unit Tests Move Down Run Test 3,Restart run VS 4,Create UnitTest ...

  7. mepg

    MPEG(Moving Picture Experts Group,动态图像专家组)

  8. RestTemplate 超级严重BUG之 restTemplate.getForEntity对于下载文件的地址请求 header不起作用

    错误下载:RestTemplate restTemplate=new RestTemplate();HttpHeaders httpHeaders=new HttpHeaders();httpHead ...

  9. 给Java新手的一些建议----Java知识点归纳(J2EE and Web 部分)

    J2EE(Java2 Enterprise Edition) 刚出现时一般会用于开发企业内部的应用系统,特别是web应用,所以渐渐,有些人就会把J2EE和web模式画上了等号.但是其实 J2EE 里面 ...

  10. 为何使用Shell脚本

    为何使用Shell脚本 分类: linux shell脚本学习2012-09-12 17:18 78人阅读 评论(0) 收藏 举报 shell脚本任务工作         s h e l l 脚本在处 ...