码迷,mamicode.com
首页 > 系统相关 > 详细

How to configure dns slave server in Linux

时间:2014-06-10 22:29:28      阅读:432      评论:0      收藏:0      [点我收藏+]

标签:different   address   otherwise   server   records   

A DNS server, or name server, is used to resolve an IP address to a hostname or vice versa.
You can set up four different types of DNS servers:

  • master DNS server for your domain(s), which stores authoritative records for your domain.

  • slave DNS server, which relies on a master DNS server for data.

  • caching-only DNS server, which stores recent requests like a proxy server. It otherwise refers to other DNS servers.

  • forwarding-only DNS server, which refers all requests to other DNS servers.

In our pervious article we have configured Master dns server. In this tutorial we will extended pervious article and configuresalve dns server. This article is the second part of How to configure dns server step by step guide. We suggest you to review pervious article before starting it.

Configure dns slave server

For this example we are using three systems one linux server one linux clients and one window clients.

We have configured master DNS server with ip address of 192.168.0.254 and hostname server.example.com on linux server. Now we will configure slave DNS server on linux clients

To configure slave DNS server go on client1 system.

First test connectivity from dns server by ping commands and check necessary rpm. bind and caching-nameserver rpm is required to configure dns. check them for install if not found install them.
bubuko.com,布布扣 
set hostname to client1 and ip address to 192.168.0.1 And create a new named.conf file
bubuko.com,布布扣

We are using bind‘s chroot features so all our necessary files will be located in chroot directory. Set directory location to/var/named. As we are configuring slave server so we need not to define the location of zone database files. Zone database file can be created and modified only on master server. A slave server only copied it‘s from master server.

Do editing exactly as shown here in image in named.conf 
bubuko.com,布布扣
save this file with :wq and exit

If you cannot create this file manually then download this pre configured file and copy to /var/named/chroot/etc/named.conf

To download do right click here and choose save link As.. 
named.conf

Now restart the named service. It should be start without any error.
bubuko.com,布布扣

Congratulation you have configured both Master and client DNS server. Now we will configure dns client and test it with dns server.

Configure Window DNS Client

Now go on windows xp system and test connectivity from DNS server. And set DNS ip address in LAN card properties.

bubuko.com,布布扣

Now go on commands prompt and ping from other client by name to test dns
bubuko.com,布布扣
Alternately You can also verify DNS server by nslookup command
bubuko.com,布布扣
Test also by pinging server from name 
bubuko.com,布布扣

Configure Linux DNS clients

RHCE Exam question 
Dig Server.example.com, Resolve to successfully through DNS Where DNS server is 192.168.0.254.

RHCE Exam question2

Your System is configured in 192.168.0.0/24 Network and your nameserver is 192.168.0.254. Make successfully resolve to server.example.com.

On command line interface you don‘t have any options to set DNS ip in network configuration window. IP of DNS server can be set from /etc/resolv.conf file. Each nameserver line represents a DNS server, and the search line specifies domain names to try if only the first part of a hostname is used. For example, if just the name client1 is used as a hostname, client1. example.com will also be tried if the /etc/resolv.conf file is configured as shown in image below on the system.

To set DNS ip open /etc/resolv.conf file 
bubuko.com,布布扣
set nameserver ip to 192.168.0.254 and search option to example.com
bubuko.com,布布扣
After saving /etc/resolv.conf file restart the network service 
bubuko.com,布布扣

dig server.example.com to test dns server 
bubuko.com,布布扣
now verify by pinging to other client from name 
bubuko.com,布布扣


本文出自 “小小鸟你妈” 博客,请务必保留此出处http://xiaoxiaoniao.blog.51cto.com/8727225/1423548

How to configure dns slave server in Linux,布布扣,bubuko.com

How to configure dns slave server in Linux

标签:different   address   otherwise   server   records   

原文地址:http://xiaoxiaoniao.blog.51cto.com/8727225/1423548

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!