Operating System - Linux
1819681 Members
3514 Online
109605 Solutions
New Discussion юеВ

DNS configuration with redhat9

 
Tendai Mataranyika
Occasional Contributor

DNS configuration with redhat9

Guys, iam new to Linux networking. I want to configure DNS using redhat9 from scratch. I just want to think of a name, e.g tendai.co.zw as the dns name and then configure it. Can someone give me a simple step by step approach so that i will be able to test my dns using nslookup or dig.
5 REPLIES 5
Stuart Browne
Honored Contributor

Re: DNS configuration with redhat9

You want to configure RH9 to use a DNS server, or you want to configure bind (named) to serve out domains?

If the first, you need to log into the system as the 'root' user, and modify the file '/etc/resolv.conf', adding a line similar to:

nameserver 192.168.1.254

where '192.168.1.254' is the DNS server IP provided by your ISP.

If you mean the latter, then you need to modify the '/etc/named.conf' file, adding in a section similar to:

zone "tendai.co.zw" IN {
type master;
file "tendai.co.zw.zone";
allow-update { none; };
};

From there, you need to create a file called '/var/named/tendai.co.zw.zone', and put the zone information in it, similar to:

$TTL 86400
$ORIGIN localhost.
@ 1D IN SOA @ root (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

1D IN NS @
1D IN A 127.0.0.1

followed by A records for individual machines within the domain, and MX for mail exchangers.

From here, you really need to read some information about how to do more indepth configuration, start with https://www.redhat.com/docs/manuals/linux/RHL-9-Manual/ref-guide/ch-bind.html and then look at the RFC's (1033 and 1034).

After that's all done, all you need to do is start the service:

service named start
chkconfig named on

unf.. ;)
One long-haired git at your service...
Tendai Mataranyika
Occasional Contributor

Re: DNS configuration with redhat9

Thanks for the reply Stuart, but after following exactly what u have said, after restarting named, if i try to test the dns by using nslookup e.g nslookup
tendai.co.zw

The result is as follows:

Server: 10.114.39.71
Address: 10.114.39.71#53

**server can't find tendai.co.zw: SERVFAIL

where 10.114.39.71 is the ip address of my linux box.
What then am i suppose to do?

Stuart Browne
Honored Contributor

Re: DNS configuration with redhat9

10.114.39.71 is listed in your '/etc/resolv.conf'.

If you've configured your name server, and restarted it, you'll need to tell your Linux box to use your DNS server, so do the first thing I said. Modify '/etc/resolv.conf' and point it to either the ethernet address of the box, or to '127.0.0.1' (localhost), then try your 'nslookup' or 'dig' again.
One long-haired git at your service...
xyko_1
Esteemed Contributor

Re: DNS configuration with redhat9

Hi Tendai,

I think you have to enhance your knowledge about dns, here you have some helpfull information that may help you to configure youe server.

http://www.linuxhomenetworking.com/linux-hn/dns-static.htm

Try to look all documentation, it's very good for beginners, and for advanced users too.

regards,
xyko
Steven E. Protter
Exalted Contributor

Re: DNS configuration with redhat9

You must have network connectivity to the servers defined in /etc/resolv.conf

As a general reference, this document is quite useful at managing the entire configuration.

http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html/DNS-HOWTO-html.tar.gz
http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/DNS-HOWTO.html
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com