Visit Our UNIX and Linux User Community


How to set dns in rhel4

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat How to set dns in rhel4
# 1  
Old 10-25-2009
How to set dns in rhel4

Hi,

I would like to know on how to set up dns on my server running rhel 4, the purpose so other computers can look through this server(trial1) when they nslookup and so on..

I tried to put my server name(trial1) and ip address in /etc/resolv.conf but when I try on the other server to nslookup, it didnt succesful..
nb: this is only for my LAN only.. means, other pc or laptop or other machines can connect to this dns or reversable..

/etc/resolv.conf
Code:
search trial1
trial1 192.168.20.21

I thought by doin this it should allow other server to recoqnize my dns
sorry I'm quite new.. thanks in advance Smilie

Last edited by pludi; 10-25-2009 at 09:14 AM.. Reason: code tags, please...
# 2  
Old 10-25-2009
The 'search' directive of resolv.conf doesn't specify which servers to search, but what domains to search through. Example: if you specify two search domains
Code:
search bar.com
search foo.bar.com

and do a lookup for the name 'baz', the resolver will look for
  • baz.
  • baz.bar.com.
  • baz.foo.bar.com.

Name servers, where the resolver should query about them, are specified by the 'nameserver' directive, eg
Code:
nameserver 192.168.0.2
nameserver 192.168.0.3

will query 192.168.0.2 first, and, if that's not reachable, 192.168.0.3.

For your server to be able to act as a name server, you'll have to install and configure the appropriate service. One of the most used is BIND, which should be available in the RHEL repositories.

Ref: resolv.conf(5), Wikipedia on BIND, ISC BIND
# 3  
Old 10-25-2009
Redhat uses BIND (named) for DNS. There are essentially three types of DNS servers:

- caching nameserver
- slave nameserver
- master nameserver

You need to decide which one is appropriate for your particular setup.

Further information is available here: RHEL4 - Berkeley Internet Name Domain
# 4  
Old 10-26-2009
hi, thank you for your replied..

I want to setup for our local project only which is for LAN network only.. which other pc can look at my server and other machines/servers can look to this server or reversable.. can you guide me on how to setup this? I have named.conf installed on my server.. sorry I'm quite new to this, I have looked through the document or articles on internet but somehow its quite confusing.. maybe this will be a good start for others as well.. I will post this to my blog to teach other persons when I able to set this by myself..

once again thank you for your response and help for me.. appreciate it!!!

---------- Post updated 10-26-09 at 11:11 AM ---------- Previous update was 10-25-09 at 11:07 PM ----------

hi, btw this is my /etc/named.conf file.. what I do really want is other servers or pc's can look to this server.. or this server can look to other servers.. lets say I name my server trial1, trial2, trial3, trial4.. I want them can look or resolve each other if it's possible. I guess 1 server must be a master while the rest are slaves

Code:
//
// named.conf for Red Hat caching-nameserver 
//
 
options {
    directory "/var/named";
    dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
    /*
     * If there is a firewall between you and nameservers you want
     * to talk to, you might need to uncomment the query-source
     * directive below. Previous versions of BIND always asked
     * questions using port 53, but BIND 8.1 uses an unprivileged
     * port by default.
     */
     // query-source address * port 53;
};
 
// 
// a caching only nameserver config
// 
controls {
    inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
 
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; };
};
 
include "/etc/rndc.key";



---------- Post updated at 01:28 PM ---------- Previous update was at 11:11 AM ----------

lets say the name of this server is trial1, I tried to do nslookup from this trial1 server whether it will give a response.. below is my config and details
Code:
#/etc/init.d/named start [ok]

#ps -ef | grep named
named 19510 1 0 10:42 ? 00:00:02 /usr/sbin/named -u named -t /var/named/chroot

#cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
192.168.20.21 trial1

#cat /etc/resolv.conf
search trial1
nameserver 192.168.20.21

#nslookup trial1
Server: 192.168.20.21
Address: 192.168.20.21#53

** server can't find trial1: SERVFAIL

---------------------------------------

---------- Post updated at 05:35 PM ---------- Previous update was at 01:28 PM ----------

I have modified the zone and somehow able to nslookup my trial1 server.. I name the trial1 server as server.trial1.com
and I changed the zone name to server.trial1.com and modified the ipaddress inside..

the question is.. if I am using the other servers lets say TRIAL2, how can I make this trial2 to nslookup trial1?
because I tried that but it was not able to.. sigh* I have no one to guide me through this Smilie

Last edited by pludi; 10-26-2009 at 10:02 AM.. Reason: code tags, please...
# 5  
Old 10-27-2009
Quote:
hi, btw this is my /etc/named.conf file.. what I do really want is other servers or pc's can look to this server.. or this server can look to other servers.. lets say I name my server trial1, trial2, trial3, trial4.. I want them can look or resolve each other if it's possible. I guess 1 server must be a master while the rest are slaves
No, you want one system to be a master, possibly another system to be a slave, and all other systems /etc/resolv.conf should point to both the master and slave.

Previous Thread | Next Thread
Test Your Knowledge in Computers #670
Difficulty: Medium
Fourteen channels are designated in the 2.4 GHz range, spaced 5 MHz apart from each other except for a 12 MHz space before channel 14.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Set up and configure DNS in virtualbox

hi to everyone. our instructor gave us a cd containing rhel6. where on 3rd week now and he is assgning us to configure a dns. Im using rhel 6.3(anaconda). i install bind. and says:nothing to do. when i follow step by step configuration in some website i encounter problems like i have no file... (1 Reply)
Discussion started by: rpmacaspac
1 Replies

2. Red Hat

Issue in DNS set up

:wall:I am a beginer in Linux admin. I have build new DNS setting in my system. Please find the below procedure what I followed to build DNS. but at last when I fired nslookup command, its getting error. I am using RHEL5 OS. Please help me to resolve this below issue.. Advance thanks for... (1 Reply)
Discussion started by: pradipta_pks
1 Replies

3. Red Hat

DHCP & DNS - Clients get IP but don't register in DNS

I am trying to setup a CentOS 6.2 server that will be doing 3 things DHCP, DNS & Samba for a very small office (2 users). The idea being this will replace a very old Win2k server. The users are all windows based clients so only the server will be Linux based. I've installed CentOS 6.2 with... (4 Replies)
Discussion started by: FireBIade
4 Replies

4. UNIX for Advanced & Expert Users

DNS server choice: Windows DNS vs Linux BIND

I'd like to get some opnions on choosing DNS server: Windows DNS vs Linux BIND comparrsion: 1) managment, easy of use 2) Security 3) features 4) peformance 5) ?? I personally prefer Windows DNS server for management, it supports GUI and command line. But I am not sure about security... (2 Replies)
Discussion started by: honglus
2 Replies

5. Programming

How to set DNS lookup type for getaddrinfo()?

Hi there, I'm trying to do an MX type lookup using getaddrinfo(), but I can't work out how to change the lookup type to MX from the standard A - can anybody tell me how to do this? Thanks very much John G (3 Replies)
Discussion started by: JohnGraham
3 Replies

6. Red Hat

Update for RHEL4

Hi Everybody, I have some RHEL4 and RHEL5 machines, whenever i check for new updates on RHEL4 with up2date, it shows me the update which is for RHEL5 machine and not for RHEL4 machine.On the other RHEL4 machine it shows the correct update (which is for RHEL4) So i am not able to update it. Can... (2 Replies)
Discussion started by: laxmikant
2 Replies

7. Solaris

Solaris DNS Client For Microsoft DNS Server

hey guys, how to add soalris box as a microsoft DNS Client ? and how to register in the microsoft DNS ?? i managed to query from the DNS server after adding /etc/resolve.conf and editing /etc/nsswitch.conf but i need to register the soalris server (dns Client) into Microsoft DNS automatically.... (3 Replies)
Discussion started by: mduweik
3 Replies

8. Linux

DNS unable to set up!!

Hi Experts, I am a newbie like in Linux world, practising Fedora Linux on VMWare but DNS is never set up: Below are my conf files: 1. named.conf options { directory "/var/named"; /* * If there is a firewall between you and nameservers you want * to talk... (4 Replies)
Discussion started by: vikasdh
4 Replies

9. IP Networking

How can I set DNS for my website

I have developed a website using LAMP. Right now we are accessing the website using ip address(in intranet) ie http://10.192.192.162/IntraWeb/index.php I would like to access the web using name instead of ip address. ie http://www.projects.org/IntraWeb/index.php How can I set DNS for... (1 Reply)
Discussion started by: sip
1 Replies

10. UNIX for Dummies Questions & Answers

DNS set-up

Were able to set-up and configure Web,File and DHCP Services except for the DNS set-up. Isn't it that to set up dns, we have to use BIND? In Web Services, we were able to view the default page using the servers IP address, our client wants to view it using or typing the address for example... (2 Replies)
Discussion started by: carljo
2 Replies

Featured Tech Videos