RedHat5搭建简单DNS服务器
来源:互联网 发布:吉祥抽奖软件 编辑:程序博客网 时间:2024/06/04 19:45
服务安装
- yum install bind
- yum install bind-chroot
- yum install caching-nameserver-9.3.4-6.P1.el5.i386.rpm //dns配置文件模版
搭建目标
- DNS服务主机IP:192.168.1.150
- DNS服务存储网站目录
- www.abc.test1 正向解释 192.168.1.151
- 192.168.1.151 反向解释 www.abc.test1
DNS全局配置文件
- 启动DNS服务
- service named start
- vi /var/named/chroot/etc/named.caching-nameserver.conf
//// named.caching-nameserver.conf//// Provided by Red Hat caching-nameserver package to configure the// ISC BIND named(8) DNS server as a caching only nameserver // (as a localhost DNS resolver only). //// See /usr/share/doc/bind*/sample/ for example named configuration files.//// DO NOT EDIT THIS FILE - use system-config-bind or an editor// to create named.conf - edits to this file will be lost on // caching-nameserver package upgrade.//options {listen-on port 53 { any; }; //anylisten-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";query-source port 53;query-source-v6 port 53;allow-query { any; }; //any};logging {channel default_debug {file "data/named.run";severity dynamic;};};view localhost_resolver {match-clients { localhost; };match-destinations { localhost; };recursion yes;include "/etc/named.rfc1912.zones";};
DNS区域配置文件
vi /var/named/chroot/etc/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 "localdomain" IN {type master;file "localdomain.zone";allow-update { none; };};zone "localhost" IN {type master;file "localhost.zone";allow-update { none; };};zone "0.0.127.in-addr.arpa" IN {type master;file "named.local";allow-update { none; };};zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {type master;file "named.ip6.local";allow-update { none; };};zone "255.in-addr.arpa" IN {type master;file "named.broadcast";allow-update { none; };};zone "0.in-addr.arpa" IN {type master;file "named.zero";allow-update { none; };};zone "abc.test1" IN {type master;file "abc.test1.zone";allow-update {none;};};zone "1.168.192.in-addr.arpa" IN {type master;file "192.168.1.local";allow-update {none;};};
创建DNS域名文件
- cd /var/named/chroot/var/named
- cp -a localhost.zone abc.test1.zone
- cp -a named.local 192.168.1.local //cp命令的时候,谨记带上参数-a,因为文件有权限方面问题,如果不是-a可能无法启动DNS服务器
service named restart //确认区域文件命名没错,一步步确认,不要走回头路,DNS配置很敏感的
修改区域配置文件
vi localhost.zone abc.test1.zone
$TTL 86400@ IN SOA www.abc.test1. root.abc.test1. (42; serial (d.adams)3H; refresh15M; retry1W; expiry1D); minimum@ IN NS www.abc.test1.www IN A 192.168.1.151
vi 192.168.1.local
$TTL 86400@ IN SOA www.abc.test1. root.abc.test1. (1997022700; serial (d.adams)28800; refresh14400; retry3600000; expiry86400); minimum@ IN NS www.abc.test1.111 IN A www.abc.test1.
重启DNS服务service named restart
校验DNS情况
配置客户端DNS服务器
- vi /etc/resolve.conf
- 输入nameserver 192.168.1.150
主要,DNS对语法非常敏感,多备份,一步步测试,注意域名是www.abc.test1. 后面是带一个“.”号的
另外,测试客户机注意清空DNS缓存。
- RedHat5搭建简单DNS服务器
- redhat5.3 DNS服务器配置
- memcached服务器搭建(RedHat5)
- memcached服务器搭建(RedHat5)
- memcached服务器搭建(RedHat5)
- Redhat5.3搭建apach和dns
- 简单的dns主从服务器搭建实验
- 【redhat5.5】局域网搭建yum样板服务器
- 在ubuntu 12.04上搭建简单的DNS服务器
- LINUX环境下DNS服务器的简单搭建教程
- 使用BIND来搭建简单的主辅DNS服务器
- 搭建DNS服务器
- DNS服务器搭建
- CentOS DNS服务器搭建
- redhat dns服务器搭建
- 搭建DNS服务器
- DNS服务器搭建
- DNS服务器搭建笔记
- linux-基础入门
- MySQL 数据备份和恢复
- IPv6资料
- 01背包问题的一维数组解法
- ImagePanel 提供一个专门添加图片的JPanel
- RedHat5搭建简单DNS服务器
- 面向对象5
- linux-用户权限
- 01背包代码(c++)
- XMLHttpRequest 对象
- linux-进程与服务
- 网站框架
- C语言详解 - 枚举类型
- linux配置远程连接