LinuxMCE Forums

General => Users => Topic started by: nasmith1985 on September 24, 2009, 09:25:35 AM

Title: DNS Resolution
Post by: nasmith1985 on September 24, 2009, 09:25:35 AM
I have a clean install of LinuxMCE 0710 from DVD with the recommended dual NIC setup. Everything seems to be working correctly except for my internet. My client machines receive an IP from the core, but cannot resolve domain names. If I change the domain-name-servers in dhcpd.conf to the router on my external network they are able to resolve dns, but this does not last as dhcpd.conf gets re-written upon reboot and/or adding new devices. Not sure where to go from here.
Title: Re: DNS Resolution
Post by: pigdog on September 24, 2009, 03:55:32 PM
HI,

Do a search on domain name resolution and/or domain name server back at the main forum page and see if one of those posts can help you out.
Title: Re: DNS Resolution
Post by: jimbodude on September 24, 2009, 05:18:46 PM
Is your core configured to have a static IP behind your router?  I had similar issues - basically, the router was having a bad time processing DNS requests, so name resolution wasn't working (or was so slow that requests timed out before the DNS response) for systems behind the core.

I now use OpenDNS for the core's upstream DNS server (not using DNS from the router or my ISP at all), and the problems have vanished.  You can configure this in the web admin under the Advanced menu; the IPs for OpenDNS's servers are on their website.
Title: Re: DNS Resolution
Post by: nasmith1985 on September 25, 2009, 07:24:29 PM
That seemed to work, but only for about an hour. Now it looks like the client machines will resolve dns, but it's so slow that they end up timing out before resolution. I'm using OpenDNS's servers as recommended. 208.67.220.220, 208.67.222.222 This is an odd issue and I've tried looking through the forum and google for something related, but to no avail. Any help is most definitely appreciated!
Title: Re: DNS Resolution
Post by: jimbodude on September 25, 2009, 07:30:10 PM
Play around with dig ( http://www.manpagez.com/man/1/dig/ ) see if you can locate the issue more exactly.

MDs don't have dig - you need to install it with:
sudo apt-get install dnsutils
Title: Re: DNS Resolution
Post by: nasmith1985 on September 25, 2009, 07:54:24 PM
Thanks for the reply, that link doesn't seem to work. I've never used dnsutils, but am trying to find a how-to on google.
Title: Re: DNS Resolution
Post by: jimbodude on September 25, 2009, 07:59:38 PM
Link works great here.

Just do:
man dig

after you install the dnsutils package. It's not a terribly complex program.
Title: Re: DNS Resolution
Post by: nasmith1985 on September 25, 2009, 08:21:57 PM
Hmm, I used it, but I'm not exactly sure what I'm looking for in the results. Is there anyway that I can just change the default DNS server from 192.168.80.1?
Title: Re: DNS Resolution
Post by: jimbodude on September 25, 2009, 08:37:07 PM
...no, that will break everything - you would never be able to resolve "dcerouter" or any of your MDs.  You need to figure out why the Core's upstream DNS server is taking too long (or if it is taking too long).  Put the network settings back the way you found them, and locate the problem server.

If you read the man page for dig, you'll see that you can run DNS queries against different servers to see what the results are.  For instance, on the core, you can run
dig @127.0.0.1
to find out how well the Core's DNS is working or
dig @192.168.1.1
to see how the core does talking to the router (assuming that's your router's IP)

Run similar queries from the clients and the core on each of these DNS servers:
1) the core
2) the router (if there is a router on your external network before the internet modem)
3) your ISP's DNS
4) openDNS or other public DNS servers

You may need to add "+time=9999" if you're getting timeouts.  Switch up the host names that you query on - sometimes the resolved IPs are stored for a period of time for quicker retrieval.

Armed with the information from dig, you will understand where things are getting bogged down, and you can stop talking to the offending server.  In my case, it was the router and my ISP - so I was able to simply use OpenDNS for the core's upstream DNS servers.
Title: Re: DNS Resolution
Post by: nasmith1985 on September 25, 2009, 08:50:34 PM
I used dig as suggested and got results for all options. Some had faster response times, the core and my router. I've used the web admin to use dns servers from opendns, my router, and my isp, but all produce the same result which leads me to believe it is something in the linuxmce configuration. I don't understand why I can change the dns in dhcpd.conf, restart dhcp3-server and then everything works, but when left up to linuxmce it fails. This is most annoying as my entire network is down. I love the idea of linuxmce and other than this small issue, everything else seems to be working.
Title: Re: DNS Resolution
Post by: jimbodude on September 25, 2009, 10:47:36 PM
After changing the DNS server settings in the web admin, what are you doing to make them take effect?  It sounds like the upstream DNS server is not being updated on the core's DNS server...  I haven't looked at how those settings end up in the configuration files in a while...

Use dig to check and see what servers are being used in the DNS request to make sure you're using what you expect.

If you're using the wrong upstream server, try
sudo /etc/init.d/bind9 restart
after changing the settings or reboot the machine.
Title: Re: DNS Resolution
Post by: nasmith1985 on September 25, 2009, 11:03:28 PM
After updating the DNS servers from webadmin, I click update and the machine reboots itself. I checked named.conf.forwarders and it has the correct info. I suspect the problem lies within LinuxMCE because on the core I can access any website I wish, but on the clients I can only access websites by IP address.
Title: Re: DNS Resolution
Post by: jimbodude on September 25, 2009, 11:13:45 PM
From what I remember, DNS queries originating on the Core do not use the Core's DNS server - they go straight to the upstream server.  Local names are kept in the hosts file.

LinuxMCE doesn't do anything "magical" with DNS - it just configures bind...  There is either a configuration error, or a bug in bind.  Whatever you see in the configuration files is what is being used.

I'm not sure what else to tell you.  It's been quite a while since I've had any issues similar to this.  I've since started using the 0810 alpha release, so I can't even compare config files with you.
Title: Re: DNS Resolution
Post by: nasmith1985 on September 26, 2009, 08:30:12 PM
This is really odd, I woke up this morning and dns resolution seems to be working. Hopefully it continues this way. Thanks for your help and guidance, I really appreciate it!
Title: Re: DNS Resolution
Post by: sk1 on September 26, 2009, 09:37:15 PM
Sometimes it just takes a little while to get DNS to propagate across the internet, but in this case, across your network...   ;D
Title: Re: DNS Resolution
Post by: nasmith1985 on September 27, 2009, 09:39:17 PM
It appears as though after x amount of time I have to restart bind9 on the core in order for my clients to resolve dns. Anybody have any thoughts as to why I need to keep restarting bind9?
Title: Re: DNS Resolution
Post by: colinjones on September 27, 2009, 10:22:32 PM
Maybe the first query works for some reason and the result is cached, then once the TTL expires on those results, it has to query again and at that point something is stopping it working?

Currently, your clients on the internal network query the Core for results and the core then does a full recursive look up (it doesn't use your ISP's DNS servers), whereas any resolutions your core attempts to do for applications running locally (like browsers on KDE) are not using the Core's DNS server, they just use the Core's normal DNS client to query your ISP. Perhaps if you tried getting internal client resolution going the same way this might fix it?

You can simulate (similar) behaviour by setting up forwarders on the core. These will tell it not to resolve queries itself, but to forward them on to your ISP in a similar query to the DNS client running on the core. You can do this in /etc/bind/named.conf.forwarders
Title: Re: DNS Resolution
Post by: jimbodude on September 27, 2009, 10:29:00 PM
bind didn't work very well for me in 0710 - I had all kinds of strange issues.  Most were resolved by using OpenDNS, but it still crapped out every once in a while.  I also had hardware incompatibility issues with my NICs that made things even worse.  I have no issues in 0810 - you might consider trying 0810 alpha.