• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 466
  • Last Modified:

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
0
ComputerFundi
Asked:
ComputerFundi
  • 8
  • 7
  • 3
2 Solutions
 
pablouruguayCommented:
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
0
 
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:

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.
0
 
pablouruguayCommented:
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



0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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      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

0
 
pablouruguayCommented:
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
0
 
wnrossCommented:
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

So:
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 ---------
server-identifier 10.0.0.88;
ddns-update-style interim;

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

subnet 10.0.0.0 netmask 255.255.255.0{
        range  10.0.0.100 10.0.0.199;
        option routers  10.0.0.1;
        include "/etc/rndc.key";
        ignore client-updates;

        zone fundi01.com. {
                primary 127.0.0.1;
                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";

controls{
        inet 127.0.0.1 allow{
                any;
        }       keys{
                "rndc-key";
        };
};

zone "fundi01.com" {
        type master;
        file "fundi01.com.zone";
        allow-update{
                 key rndc-key;
        };
};
zone "0.0.10.in-addr.arpa" {
        type master;
        file "0.0.10.zone";
        allow-update{
                 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.

Cheers,
-Bill
0
 
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 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
0
 
wnrossCommented:
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
0
 
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 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?

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

Good luck
-Bill
0
 
ComputerFundiAuthor Commented:
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!
0
 
wnrossCommented:
Good to hear, and thanks for the points

Cheers,
-Bill
0

Featured Post

Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

  • 8
  • 7
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now