LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   red hat 8.0 nameserver works but not fully (https://www.linuxquestions.org/questions/linux-newbie-8/red-hat-8-0-nameserver-works-but-not-fully-228001/)

shard 09-07-2004 11:34 PM

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

this213 09-08-2004 01:06 AM

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

shard 09-08-2004 11:35 PM

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

shard 09-16-2004 12:05 PM

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


All times are GMT -5. The time now is 02:55 AM.