LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-08-2004, 12:34 AM   #1
shard
LQ Newbie
 
Registered: Sep 2004
Location: Baton Rouge, Louisiana USA
Distribution: Red Hat 8.0
Posts: 3

Rep: Reputation: 0
red hat 8.0 nameserver works but not fully


Hi,

I am a newbie and so the fact that I have been trying to solve this problem for more than a week is not surprising however, I have run out of ideas to try and I did not find anything similar in the newbie forum.

I set up my dns on a home network of 2 red hat 8.0 machines and one winxp. The name server seems to be working partially. the network is not connected to the internet and the ip address is static.

nslookup with no arguments gives the maessage regarding deprecation and then gives a prompt >
but unlike the name server in the department, the message does not say
default server: server name
address: .........

I can lookup the other two machines and the output for name lookup is

server: ip address
iAddress: ......

Name: ....
Address: ...

This not like the SGI unix nslookup response where nslookup without arguments give
default server:
address:

and then the prompt >

but when I do a reverse lookup by entering the ip address, I get the ipadress and the name but the ip address has the .in-addr.arpa also

address: 192.168.1.2.in-addr.arpa name: w2.domain.com

What is much worse is that I cannot look up the names from the other machines. The message is that no servers could be found. I can ping all machines from each other using the ip address. I checked the /etc/resolv.conf on the linux client and it was fine. It has the domain and the nameserver entries with the domain name and the nameserver ip address.

Initially, I created the named.conf file with the gui and got these problems. subsequently, I compared the named.conf and the zone files to examples in the red hat reference and also to those in the O'Reilly DNS and Bind book. The only difference was that the gui generated a named.conf with rndc so I commented out all the rndc related lines but nothing changed. Each time I made a change, I restarted the nameserver with service named restart. I also restarted the network service several times folloe=wed by the restart of the nameserver but the result is still the same. I checked the /var/log/messages and there is a command channel at 127.0.01:953 that starts up with the nameserver however, there are no errors.

Just in case it is useful. The named.custom file also had entries and renamed it to see if that would change anything but nothing new happened.

I have also modified the /etc/sysconfig/network-scripts/ifcfg-eth0 file to peerdns=yes to make the nameserver work to this extent.


Thank you in advance.

SH
 
Old 09-08-2004, 02:06 AM   #2
this213
Member
 
Registered: Dec 2001
Location: ./
Distribution: Fedora, CentOS, RHEL, Gentoo
Posts: 167

Rep: Reputation: 34
Redhat likes to put your options in named.custom. In your named.conf, you should see a line like:
include "named.custom";
this is the point where that file gets inserted into named.conf - you can merge the two together by copying the contents of named.custom, then pasting the entire contents over that line. Not saying to do that, just giving you an idea of how that works.

In one of these two files you should have a block that states something like:
Code:
controls {
    inet 127.0.0.1 allow { localhost; 192.168.1.0/24; } keys {rndckey; };
};
This block states that the nameserver listens on 127.0.0.1 (localhost) and that localhost (or 127.0.0.1) and the entire class C network 192.168.1.xxx (denoted by the 0 on the end) have access to the nameserver using the security key stored in rndckey.

In either your named.conf or, more likely if a RedHat GUI created this, in your named.custom file, you should have an options block such as:
Code:
options {
    directory "/var/named/";
    listen-on { 127.0.0.1; 192.168.1.1; };
    allow-query { 127.0.0.1; 192.168.1.0/24; };
};
From the first line, this states that:
directory "/var/named/"; = Your per-domain configuration files are stored in /var/named/

listen-on { 127.0.0.1; 192.168.1.1/24; }; = The nameserver listens on 127.0.0.1 and 192.168.0.1

allow-query { 127.0.0.1; 192.168.1.0/24; }; = The nameserver will accept queries from the entire 192.168.1.0 class C network as well as localhost (127.0.0.1).

Note that your values for each of these blocks may be different (and probably are) depending on your exact network setup, these are just educated guesses for what should be there.

If all that looks right, open each of your zone files and check the serial numbers - make sure they're all different. RedHat likes to make zone files with serial numbers like "2" but standard practice is to use the date (YYYYMMDD), followed by 2 digits for the number of modifications for that date. So if you rewrote the zone file 8 times today, the serial number would be 2004090808 - this has the added bonus of letting you know the last time you edited a particular zone. More importantly, it increments the serial number, which nameservers will use if there gets to be a cache contest between 2 nameservers with varying records.

Try to ping one of your domain names from the nameserver box. If you can ping a domain that's only specified in that nameserver (ie, not google.com, but perhaps testdomain.cxm - note the "x"). If you can do that, the nameserver is working.

On the client machines (the machines that are supposed to be using this nameserver), be sure you've set that server as it's primary DNS. Use your ISP's nameserver as a secondary just in case yours goes down (so it won't cut out your whole network because nothing resolves). Then try to ping your testdomain.cxm from that machine. If that works, you've got it set up right.

As to nslookup - ignore the statement about it being depreciated. I guess these days you're supposed to use dig instead of nslookup - but I've always gotten everything I've ever needed from nslookup, and you will too if you're configured right.

when you start nslookup from the nameserver box, type in:
server
and hit enter. This will give you your list of nameservers. You can always change servers by doing:
server 192.168.1.1
or
server ns.mynameserver.com

Once you've made sure you're querying your nameserver, do:
set q=ANY
testdomain.cxm

this should spit out a zone transfer - a listing of all of the records within the testdomain.cxm domain that you are authoratative for, ie: mail servers, nameservers, ect.

I got a bit more wordy than I had planned, but perhaps it'll help you (or someone else) out.

This
 
Old 09-09-2004, 12:35 AM   #3
shard
LQ Newbie
 
Registered: Sep 2004
Location: Baton Rouge, Louisiana USA
Distribution: Red Hat 8.0
Posts: 3

Original Poster
Rep: Reputation: 0
Hi this,

Thank you very much for the detailed suggestions. I checked the named.conf and named.cuxtom file. The controls and options blocks were in named.conf. The GUI-generated file did not have all the statements that you had mentioned in your post. The controls statement had localhost but not the Ip so I added that. The options had the directory but not the listen and allow-query statement so I added those. There was no change after restarting named. I then created a new named.conf file without the rndc with one master nameserver but the result did not change. The nameserver could look up the clients but the clients could not connect to the server. Finally, I removed the firewall from the server and the clients could reach the nameserver. This was strange because I think I saw somewhere that even with the security level set to high, the dns replies would get through. There is still something wrong because I cannot use dig even when nslookup and host give the correct output.

There is also another strange problem. Once the client could lookup itself and the nameserver, I tried to ping the nameserver by name and it failed but in a different way. The message was connect: network is not reachable. Client lookup by name of another client that was down gave the message host unreachable but not network unreachable. Besides, I could ping the nameserver by IP. I am getting an unhandled exception message on the nameserver machine and it becomes sluggish and then freezes.

This is probably a separate problem.

I hope you or someone else can give some suggestions

Thanks again for your very helpful and informative reply.

SH
 
Old 09-16-2004, 01:05 PM   #4
shard
LQ Newbie
 
Registered: Sep 2004
Location: Baton Rouge, Louisiana USA
Distribution: Red Hat 8.0
Posts: 3

Original Poster
Rep: Reputation: 0
Hi

I am still having problems with the nameserver. I added a second nic on the linux machine to use it as a router to share the cable modem with another linux box. I configured one nic for dhcp so that it could connect to the internet through the cable modem.
I then configured the second nic for static ip for the local network. The nameserver on this box (router) can lookup hosts on the internet. Its resolv.conf file is generated by the dhcp from the ISP and so it contains the nameservers of the ISP only. I cannot look the hosts on the local network unless I add the local ip for this machine to its resolv.conf file.
Question #1. Is this how it should be done? Every time I restart the network on this machine, the local ip is erased from the resolv.conf file and so the name server cannot look up the local machines.

Problem #2 When I add the ip (local) to the resolv.conf file of the nameserver, I can use the nameserver to lookup hosts on the local network and on the internet. However, I am not able to lookup a host on the internet from another machine on the local network.
The client on the local network has the the nameserver's ip address in its resolv.conf file and it has the same static ip (ip for the local network) of the router (also the nameserver) as its gateway address. In spite of this the client is not able to look up hosts on the internet evern though it can lookup hosts on the local netowrk.

Thanks in advance for your help

SH
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Lexmark driver that works with Linux Red Hat jilai Linux - Newbie 1 04-18-2005 12:23 AM
Red Hat Network, how it works billybilly Red Hat 1 11-17-2004 09:22 AM
After installing Red Hat 9 the system will not boot fully lluciano Red Hat 0 02-16-2004 03:21 PM
dhcp...works in XP, but in Red Hat 9 can't get out of intranet hollering Linux - Networking 0 12-01-2003 09:36 AM
What cheap sound card works in Red Hat 8 nemo2002 Linux - Hardware 12 12-26-2002 12:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration