安装最简单的DNS服务器
来源:互联网 发布:在淘宝上买黄金可靠吗 编辑:程序博客网 时间:2024/06/08 08:47
OS:redhat5.4 64bit
1.首先检查DNS需要的rpm报
[root@ntpdns named]# rpm -qa | grep bind
ypbind-1.19-12.el5
bind-chroot-9.3.6-4.P1.el5
bind-libs-9.3.6-4.P1.el5
bind-utils-9.3.6-4.P1.el5
kdebindings-3.5.4-6.el5
bind-9.3.6-4.P1.el5
[root@ntpdns etc]# rpm -qa | grep caching
caching-nameserver-9.3.6-4.P1.el5
2.配置本地IP地址
[root@ntpdns etc]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
DEVICE=eth0
BOOTPROTO=none
HWADDR=00:0c:29:c2:f5:ee
ONBOOT=yes
DHCP_HOSTNAME=ntpdns
IPADDR=192.168.80.254
NETMASK=255.255.255.0
GATEWAY=192.168.80.1
TYPE=Ethernet
3.关闭防火墙和selinux
[root@ntpdns etc]# service iptables status
防火墙已停
[root@ntpdns etc]# cat /etc/sysconfig/selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
4编辑name.conf文件
[root@ntpdns etc]# cd /var/named/chroot/etc/
cp -p named.caching-nameserver.conf named.conf
编辑named.conf
cat named.conf
options {
listen-on port 53 { any; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
// Those options should be used carefully because they disable port
// randomization
// query-source port 53;
// query-source-v6 port 53;
allow-query { 192.168.80.0/24; };
allow-query-cache { any; };
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
view localhost_resolver {
match-clients { any; };
match-destinations { any; };
recursion yes;
include "/etc/named.rfc1912.zones";
};
5编辑named.rfc1912.zones文件
[root@ntpdns etc]# cat named.rfc1912.zones
// named.rfc1912.zones:
//
// Provided by Red Hat caching-nameserver package
//
// ISC BIND named zone configuration for zones recommended by
// RFC 1912 section 4.1 : localhost TLDs and address zones
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
zone "." IN {
type hint;
file "named.ca";
};
zone "junshi.com" IN {
type master;
file "junshi.com.zone";
allow-update { none; };
};
zone "80.168.192.in-addr.arpa" IN {
type master;
file "192.168.80.local";
allow-update { none; };
};
6 编辑zone文件和local文件
cd /var/named/chroot/var/named/
cp -a localhost.zone junshi.com.zone
cp -a named.local 192.168.80.local
[root@ntpdns named]# cat junshi.com.zone
$TTL 86400
@ IN SOA junshi.com. root.junshi.com (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
@ IN NS www.junshi.com.
www.junshi.com. IN A 192.168.80.254
www.junshi.com. IN A 192.168.80.253
www.junshi.com. IN A 192.168.80.252
IN AAAA ::1
[root@ntpdns named]# cat 192.168.80.local
$TTL 86400
@ IN SOA www.junshi.com. root.junshi.com. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS www.junshi.com.
254 IN PTR www.junshi.com.
253 IN PTR www.junshi.com.
252 IN PTR www.junshi.com.
service named restart
nslookup www.junshi.com
- 安装最简单的DNS服务器
- 简单编译安装DNS服务器
- DNS服务器的安装
- Linux-DNS服务器的简单配置
- 简单的dns主从服务器搭建实验
- 简单DNS服务器架设
- DNS服务器简单指南
- DNS服务器的安装 和配置
- LINUX下DNS服务器的安装
- DNS服务器的安装与配置
- DNS服务器的安装与配置
- DNS服务器的安装与部署
- 安装配置DNS服务器、DDNS的配置
- centos安装DNS服务器
- 安装DNS服务器
- 最简单的web服务器
- 最简单的时间服务器
- xp下安装DNS的简单方法
- CheckBox在listView滑动后状态改变的解决办法
- 快速排序 and 第K大数
- qemu/kvm/qemu-kvm/virsh的区别(转)
- 【翻译】在Ext JS和Sencha Touch中创建自定义布局
- Linux设备模型--platform
- 安装最简单的DNS服务器
- Android中的Fragment使用
- 算法竞赛入门经典(第2版)习题3-7 DNA序列 DNA Consensus String UVa1368
- adb 命令详解
- 经验总结---编译出可以在Android上执行的可执行文件
- 掌握了写作的性感符号列表的艺术
- C++的未来和指针
- Bridge 设计模式
- 面试算法(十一)打印1到最大的n位数