Ubuntu下域名服务器bind9 安装与配置
Ubuntu下域名服务器bind9 安装与配置
//更新 ubuntu :sudo apt update
//1.安装:
//1.2安装bind9
//sudo apt-get install bind9 bind9utils bind9-doc dnsutils
//1.3安装bind9文档
//sudo apt-get install bind9-doc
//测试 bind9 是否安装:named -v
//1.4修改防火墙规则允许 bind (53)端口开放sudo ufw allow 53
//2.配置
//2.1配置option文件
//sudo nano /etc/bind/named.conf.options
options {
directory “/var/cache/bind”;//目录
auth-nxdomain no; # 按照 RFC1035
// listen-on-v6 { any; };
listen-on port 53 { localhost; 192.168.0.0/24; };//设置53为监听端口
allow-query { localhost; 192.168.0.0/24; };
forwarders { 8.8.8.8; };
recursion yes;//轮询
};
//2.2配置zone:
//sudo nano /etc/named.conf.local
zone “example.yours” {
type master;
file “/etc/bind/forward.linuxtechi.local”;
};
zone “0.168.192.in-addr.arpa” {
type master;
file “/etc/bind/reverse.linuxtechi.local”;
};
//2.3配置forward文档
//备份配置文件
//sudo cp /etc/bind/db.local /etc/bind/forward.example.yours
//sudo nano forward.example.yours
$TTL 604800
@ IN SOA primary.linuxtechi.local. root.primary.linuxtechi.local. (
6 ; Serial
604820 ; Refresh
86600 ; Retry
2419600 ; Expire
604600 ) ; Negative Cache TTL
;Name Server Information
@ IN NS primary.example.yours.
;IP address of Your Domain Name Server(DNS)
primary IN A 192.168.0.40
;Mail Server MX (Mail exchanger) Record
example.yours. IN MX 10 mail.example.yours.
;A Record for Host names
www IN A 192.168.0.50
mail IN A 192.168.0.60
;CNAME Record
ftp IN CNAME www.example.yours.
//2.4配置reverse文档
//备份
sudo cp /etc/bind/db.127 /etc/bind/reverse.example.yours
sudo nano /etc/bind/reverse.example.yours
$TTL 604800
@ IN SOA example.yours.root. example.yours. (
21 ; Serial
604820 ; Refresh
864500 ; Retry
2419270 ; Expire
604880 ) ; Negative Cache TTL
;Your Name Server Info
@ IN NS primary.example.yours.
primary IN A 192.168.0.40
;Reverse Lookup for Your DNS Server
40 IN PTR primary.example.yours.
;PTR Record IP address to HostName
50 IN PTR www.example.yours.
60 IN PTR mail.example.yours.
//3.重启生效
//sudo systemctl restart bind9
//sudo systemctl enable bind9
//4.格式检查
sudo named-checkconf /etc/bind/named.conf.local
/sudo named-checkzone example.yours /etc/bind/forward.example.yours
sudo named-checkzone example.yours /etc/bind/reverse.example.yours
//5.指定本机DNS服务器地址
sudo nano /etc/resolv.conf
DNS=xx.xx.xx.xx
//6.使用 dig 命令测试 DNS
//正向检查 dig primary.example.yours
//反向检查 dig -x xx.xx.xx.xx
Ubuntu下域名服务器bind9 安装与配置相关推荐
- Ubuntu下mongodb的安装与配置
MongoDB 是一个跨平台的,面向文档的数据库,提供高性能,高可用性和可扩展性方便.这里介绍在Ubuntu下mongodb的安装与配置. 1.下载 mongodb可以在官网上下载,地址,选择Ubun ...
- ubuntu下Tomcat7的安装和配置
和前几个软件一样,Tomcat 同样是由JAVA开发的,所以,在安装前一定要装好JDK. 大家可以到 http://tomcat.apache.org/download-70.cgi 下载最新的Tom ...
- ubuntu下Pure-FTPd的安装和配置
1.安装Pure-FTPd sudo apt-get install pure-ftpd-mysql mysql-server 2.添加用户和组 sudo groupadd -g 2001 ftpgr ...
- ubuntu下bochs的安装和配置
<ORANGE'S:一个操作系统的实现>一书中选择使用虚拟计算机Bochs进行仿真. Bochs是一个x86硬件平台的开源模拟器.它可以模拟各种硬件的配置.Bochs模拟的是整个PC平台, ...
- ubuntu下cvs的安装、配置与使用
cvs的安装方式大致有两种 一种是cvs+cvsd,另一种是cvs+xinetd,我选择的是cvs+xinetd,这种做法比较节省资源,xinetd是一个后台服务管理程序,除了管理cvs之外还可以管理 ...
- Ubuntu下CodeBlocks的安装、配置及静态库动态库的简单使用举例
1. 从Ubuntu Software Center中搜索Code::Blocks并安装: 2. 在第一次启动时选择GNU GCC Compiler作为默认的编译器: 3. 生成静态库并调用操作 ...
- ubuntu下tftp的安装、配置、使用
1. 安装(注意权限,root下) $ apt-get install tftp-hpa tftpd-hpa 2. 建立目录 $ mkdir /tftpboot # 这是建立tftp传输目录. $ ...
- Ubuntu下Apache的安装和配置——web服务器
Apache2 <百度百科 > Apache是世界使用排名第一的Web服务器软件.它可以运行在几乎所有广泛使用的计算机平台上,由于其跨平台和安全性被广泛使用,是最流行的Web服务器端软件之 ...
- Linux(Ubuntu)下MySQL的安装与配置
1)首先检查系统中是否已经安装了MySQL 在终端里面输入 sudo netstat -tap | grep mysql 若没有反映,没有显示已安装结果,则没有安装.若如下显示,则表示已经安装 2)如 ...
最新文章
- mondrain多维分析引擎+saiku web展现层的演示环境搭建
- java 连连看_java—连连看-实现封装
- instanceof不是根据构造函数进行判断,而是原型链
- 圣诞前夜预告|深入理解Linux内核经验分享
- 一分钟明确 VS manifest 原理
- Java之jdk和CGLib实现动态代理
- php 编写线程教程,php 实现多线程
- c语言中用简易暗纹来输入密码,确定夫琅和费单缝衍射明、暗纹位置的不同教学方法的讨论...
- JVM优化系列-对象内存分配和回收的细节
- SQL Server中 char与varchar
- 读研计算机技术与控制工程比较,电气工程与控制工程研究生考研就业的区别,哪个比较好...
- SIM800L 模块 使用AT命令打电话
- 基于51单片机的无线测温系统
- docker minio部署作为shareX截图软件的图床
- Mac升级自带PHP版本(非Homebrew方式)
- segy和su文件格式说明
- NEO4J-相似度算法03-皮尔逊相似度(Pearson)应用场景简介
- Vuforia下载详解
- Mutex与Semaphore 第二部分 互斥锁
- 【JavaWeb-遇错】继承或者实现Servlet相关时总是报红或者包导不进来