Link to home
Start Free TrialLog in
Avatar of ComputerFundi
ComputerFundiFlag for United Kingdom of Great Britain and Northern Ireland

asked on

DNS on FC4 not working with router based DHCP

Hi
I'm testing a sipXpbx installation for a client on my home network and am struggling to correctly configure DHCP & DNS services. I'm pretty new to Linux.

On my home network I have a simple broadband router (D-Link) which is running DHCP & using 2 DNS servers from by ISP. The sipXpbx installation instructions suggest that I need to have DNS (& possibly DHCP) running on my FC4 machine, so I have installed the DNS as per their instructions, but it doesn't work. I'd prefer to keep the DHCP services on the router. Is it possible to have that kind of setup working? Or do I have to run DHCP services from the FC4 machine?
At the moment, the FC4 machine cannot see the internet (i.e ping to google.co.uk fails. ping to the google ip also fails). HELP!
FC4 kernel = 2.6.16
sipXpbx ver  = 3.2
SOLUTION
Avatar of Pablo Allietti
Pablo Allietti
Flag of Uruguay image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ComputerFundi

ASKER

Thank you pablouruguay - I can now ping IP addresses & names from the FC4 machine, and yum update is working again. However, I don't think the DNS is fully working:

in /etc/hosts I have the following entry for the FC4 machine:

10.0.0.88      sipx.fundi01.com sipx

If I ping sipx.fundi01.com from my windows machine on the LAN it fails.
Furthermore, if I use dig -t A sipx.fundi01.com on the FC4 machine (after 10 seconds) I get:

->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 35320
flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

SERVER: 10.0.0.1#53(10.0.0.1)

I'm guessing that this represents a failure rather than success?

If I do nslookup sipx.fundi01.com it fails.
ok. the problem is that you need to create a dns zone for fundi01.com if that exist you only need to add a line in this zone like

sipx                A       10.0.0.88



I have a file called fundi01.com.zone in /var/named
It haas the following entries as per the sipfoundry site:

localhost       A      127.0.0.1
sipx            A      10.0.0.88

_sip._udp       SRV    100     1       5060    sipx
_sip._tcp       SRV    200     1       5060    sipx
_sips._tcp      SRV    300     1       5060    sipx

sipx            A      10.0.0.88

this line is correct. dns should answer your nslookup  a question .. you fedora have a 10.xx.xx.xx ip address ? but i ask another question... ;)   why do you want to resolv 10..xx.xx.xx networks? are internal you dont need to resolv to go outside
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi Bill
Thanks for your post.
Yes, I need the SIP applications to resolve. Your dhcp instructions look similar to those on the sipfoundry site and I'll try them after the weekend.

I have the DSL-G604T router.
The DNS config section allows 3 options:

Disable DNS Relay
Use Auto discovered DNS Server only
Use User Discovered DNS Server only
It has space for a Primary & Secondary. Can I switch to User discovered & change either primary or secondary to 10.0.0.88 or is it not as simple as that?

If these capabilities are insufficient, what capability am I looking for in a new router, or do you have a suggestion for a (budget) model?

Most likely in the eventual production environment I may have DHCP being served by either a router or Windows 2003 Server, so I'm keen to "prove" a configuration where DHCP resides on a different device from the SIP server.

Having said that, I will after the weekend try your dhcpd configuration.

Jon
Avatar of wnross
wnross

Yeah, actually that would work, the key is to make sure DHCP clients know to use your server for DNS,
so since you have a better router, you should be able to use the User Discovered config.

Cheers,
-Bill
Well, I tried using "User Configured DNS" and that didn't work, so I've configured dhcpd on the sipx server and had that working. Unfortunately DNS is still not working:

If I ping anything (named) from the windows client it fails. The properties of the adapter say that 10.0.0.88 is the DNS server, but names are not resolved. Even on the sipx server itself, if i ping sipx it fails. I've used named-checkconf and named-checkzone to do basic config checks and they're OK. I've double-checked entires in numerous /etc/ files.

dig -t A sipx.fundi01.com still doesn't work.

It seems as though named is running it isn't responding to DNS requests. Any ideas?

my dhcpd.conf and named.conf files are as per the sipfoundry instructions rather than yours, but it is basically the same. Their instructions don't enambe netbios. Is that significant?

Netbios is important if you are running your unix box as a fileserver as well as a SIP box.

As for setup, named.conf files are notoriously easy to mess up due to the stringent semicolon and brace rules, however bind tends to send back
an "OK" even if the server failed to start :(

Try This:
tail -f /var/log/messages &
/etc/init.d/named restart

Paste in the output here

Also, you might want to see what else is different from the information I gave you

Cheers,
-Bill
Hi Bill
It seems the issue with DNS is a bit deeper.

When I run nslookup sipx on my windows machine I get "Can't find server name for 10.0.0.88: no response from server.
In the properties for the ethernet adapter, it correctly has 10.0.0.88 as both the dhcp and dns server & 10.0.0.1 as the gateway.

Now, on the FC4 machine I have done tail -f /var/log/messages - there are several DHCP messages, but none from DNS.

When I do service dhcpd status I get dhcpd is running
When I do service named status I get nothing (no response at all)
When I do service dhcpd start or stop I get the [OK] confirmation.
Doing the same with named, I get no response, just the # prompt.

If I do ps aux | grep dhcpd I get a couple of process lines - dhcpd itself and my grep command.
If I do ps aux | grep named I just get the grep command, nothing else.
So, conclusively, named is not running, but when I try to run it I get no messages telling me why. No error. nothing.

I've double-checked all the config files and file permissions.

I wondered if BIND was even installed!
rpm -q bind gives: bind-9.3.1-20.FC4

I'm logged in all the time as root.

Help!!
BIND is clearly installed, but the script you downloaded from the SIP site is likely for a totally different version of BIND.  If you did not have bind,
service named start would have resulted in an error.

DNS Setup
* /etc/named.conf: Use the sample I gave at the top of this discussion
* /etc/rndc.key: As indicated above
* /etc/rndc.conf: See below
-------------  CUT HERE ----------------
options {
        default-server  localhost;
        default-key     "key";
};

server localhost {
        key     "rndc-key";
};

include "/etc/rndc.key";
------------------ CUT HERE -----------------

Use zone files similar to the ones I already gave, make sure they are in /var/named

finally:
   chown -R named:named /var/named
tail -f /var/log/messages &
service named start

Note any errors

Cheers,
-Bill
Bill
No difference. The script which I download from the SIP site says "The Linux DNS Server is called bind or named; we need version 9 ..."
I'm wondering now whether the installation of bind is corrupt. I've attempted a removal and re-install (That often fixes things in the world of Windows. Is it the same with Linux?) , but yum can't connect to the internet, so fails. Is there a way to configure yum to work without an intenet connection? Where is the file which tells my FC4 machine the address of the gateway?
 
Jon
1) What does the messgae log tell you? Paste here.

2) Linux Networking 101
/etc/resolv.conf
#nameserver 127.0.0.1
nameserver xxx.yyy.zzz.ww1
nameserver xxx.yyy.zzz.ww2

/etc/sysconfig/network
GATEWAY=10.0.0.1
HOSTNAME=sipx

/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
IPADDR=10.0.0.88
NETMASK=255.255.255.0

However I strongly suspect that bind is fine, just misconfigured.

Again, note any errors and paste them here

Cheers,
-Bill
Bill
I've fixed the yum problem by changing the nameserver entry in resolv.conf to the gateway address.
I've removed & re-installed bind and bind-chroot (on FC4 bind-chroot is normally installed by default apparently). I believe this is the source of my problems. Now when I start bind I get errors on screen [FAILED] and in the messages log, all to do with default zone files (eg. localhost.zone, named.broadcast) missing from /var/named/chroot/var/named. Somehow these files have been reomved during my remove / install exercise. I'm pretty confident that once I recreate these files It'll begin to work.

Unfortunately at the the same time as all this the DNS services on the production W2003 server at my client's office have just died, so I'm trying to fix that. Once repaired, I'll be back to FC4 again.
Thanks
Jon
Looks like everything is working now?

Good luck
-Bill
Yep
I manually created all the default zone files as per a linux site somewhere & named started immediately without errors. windows client works fine.
I'll be double-checking tomorrow whether I can in fact run DHCP from the router and DNs on the FC4 machine.
Thanks very much for your assistance & patience!
Good to hear, and thanks for the points

Cheers,
-Bill