DNS on FC4 not working with router based DHCP

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
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

one question, in the dhcp in the router you can specify that the DNS server are in FC4 box?
open port 53 in the router for dns
ComputerFundiAuthor Commented:
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:      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


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

Introduction to R

R is considered the predominant language for data scientist and statisticians. Learn how to use R for your own data science projects.

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

localhost       A
sipx            A

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

sipx            A

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
Because he needs the SIP applications to resolve even in his local network.

Now ComputerFundi:
No, you can't run the DHCP server from the router, because for local DNS to work, your local DHCP server must tell
all the machines in the network where to find the DNS Server (Currently located on sipx)

If you could configure your router to send the correct DNS information, life would be simple, but you probably
have something like a DI-604 which is too primitive for that

1) Install dhcpd on your server
2) Statically assign (if you haven't done so already) the ip address for sipx
3) create a file called /etc/dhcpd.conf
--------- CUT HERE ---------
ddns-update-style interim;

option domain-name      "fundi01.com";
option domain-name-servers;
option netbios-name-servers;
option netbios-node-type        0x8;

subnet netmask{
        option routers;
        include "/etc/rndc.key";
        ignore client-updates;

        zone fundi01.com. {
                key "rndc-key";
--------- CUT HERE ---------

4) check your /etc/named.conf for the following pieces: (Your file will have more info in it, just compare with what I'm showing you)
options {
        directory "/var/named";
        pid-file "/var/run/named/named.pid";

include "/etc/rndc.key";

        inet allow{
        }       keys{

zone "fundi01.com" {
        type master;
        file "fundi01.com.zone";
                 key rndc-key;
zone "0.0.10.in-addr.arpa" {
        type master;
        file "0.0.10.zone";
                 key rndc-key;
5) Check /etc/rndc.conf for the use of the rndc-key, add or edit if it does not exist:

include "/etc/rndc.key";

6) Ensure rndc.key exists
dns-keygen [prints something like basjdfd7345y32j4h6== to the screen]
vi /etc/rndc.key
key "rndc-key" {
        algorithm hmac-md5;
        secret "basjdfd7345y32j4h6==";           <--- copy from dns-keygen

7) Check permissions
chown named:named /etc/rndc.key
chown named:named /var/named/*
chmod 400 /etc/rndc.key

8) start dns, dhcp, check for errors
service named start
service dhcpd start

9) Disable DHCP, DNS from the D-Link router
10) Restart windows, all network browsing should still work, pinging sipx will work, and all is good.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ComputerFundiAuthor Commented:
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 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.

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.

ComputerFundiAuthor Commented:
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 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

ComputerFundiAuthor Commented:
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 no response from server.
In the properties for the ethernet adapter, it correctly has as both the dhcp and dns server & 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.

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

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

Note any errors

ComputerFundiAuthor Commented:
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?
1) What does the messgae log tell you? Paste here.

2) Linux Networking 101
nameserver xxx.yyy.zzz.ww1
nameserver xxx.yyy.zzz.ww2



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

Again, note any errors and paste them here

ComputerFundiAuthor Commented:
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.
Looks like everything is working now?

Good luck
ComputerFundiAuthor Commented:
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

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Networking

From novice to tech pro — start learning today.