LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-25-2010, 05:20 AM   #1
brixtoncalling
Member
 
Registered: Jul 2008
Location: British Columbia
Distribution: Slackware current
Posts: 403

Rep: Reputation: 67
resolv.conf problem?


I'm having a problem with DNS resolution in 13.1.

This problem cropped up while I was running current approximately about the time I upgraded to KDE 4.3.5.

Essentially, when I connect to the internet, no command line application is able to resolve any domain names.

Amongst KDE apps, only http:// domain names are resolved (https, ftp, pop, etc all fail).

In Firefox, everything works.

Eventually I figured out that by manually inserting "nameserver 8.8.8.8" (or any DNS server) into /etc/resolv.conf after establishing a connection, my problem is solved. If I always want to use the same DNS server, I could set DHCP_KEEPRESOLV[4]="yes" in rc.inet1.conf, but this isn't really what I want.

I'd just like to know if something changed during the past month or two that has caused me to have to manually set resolv.conf or if there's anything that I can do to fix the problem.

Thanks!

(note that my previous thread http://www.linuxquestions.org/questi...-https-806455/ was about this problem but is incorrectly titled)
 
Old 05-25-2010, 05:41 AM   #2
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
Hope if you mentioned the nameserver at your /etc/resolv.conf considerably its too fast to resolve the domain name when you access the internet or local systems by hostname, otherwise the system will search possible DNS server.

In default there may be entry as like this
Quote:
search localdomainname
 
Old 05-25-2010, 05:45 AM   #3
brixtoncalling
Member
 
Registered: Jul 2008
Location: British Columbia
Distribution: Slackware current
Posts: 403

Original Poster
Rep: Reputation: 67
Kirukan, thanks for the answer.

I forgot to add a critical piece of information. Before I added the nameserver myself, resolv.conf was empty.
 
Old 05-25-2010, 06:28 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
I am not aware of any changes to Slackware in the last month or so but I don't use current or DHCP; I do not recall a similar question here on LQ though.

The symptoms of "Amongst KDE apps, only http:// domain names are resolved (https, ftp, pop, etc all fail). In Firefox, everything works" are very strange. AFAIK name resolution has nothing to do with the protocol -- http, https, ftp, pop etc. Perhaps Firefox has a default way of resolving domain names so it works when there are no name servers in resolv.conf.

It might be illuminating to monitor the network for DNS traffic. A suitable command is tcpdump -nnl -i eth0 -s 1536 dst port 53

The key issue is why your resolv.conf is no longer being populated by DHCP (presuming it used to be). Has anything changed on the DHCP server?

The fastest nameservers should™ be your ISP's because they are closest in network terms. The most automated scenario is that their IP addresses are provided by the ISP on connection and, if your computer does not connect directly, your computer gets the DNS server IP addresses from the intervening device.

This ideal scenario goes wrong a) if your ISP does not operate their DNS service well or b) if the DNS server IP addresses are not propagated. a) is rare and can be worked around by configuring public DNS servers. These vary a lot in response times. OpenDNS seem unusually quick; perhaps they co-locate their servers on ISPs' premises; but they do deliver advertising if a name is unresolvable. Level 3 DNS servers are also quick. I don't know about google's. b) can be worked around by manual configuration as you have said you do not want to do.

A workaround for both problems is to use something like dnsmasq. dnsmasq can be configured to use many DNS servers, more than the maximum effective number of 3 that are used from resolv.conf, and it automatically uses the fastest.

If you do decide to go with the workaround of manually populating resolv.conf, I could post a simplistic script that measures DNS server response times to enable you to choose the fastest.

Last edited by catkin; 05-25-2010 at 06:29 AM. Reason: missing .
 
Old 05-25-2010, 09:50 AM   #5
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Are you running dhcpcd? Did you uncomment any of the DHCP_KEEPRESOLV lines in /etc/rc.d/rc.inet1.conf?
 
Old 05-25-2010, 11:14 AM   #6
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,176

Rep: Reputation: 233Reputation: 233Reputation: 233
Quote:
Originally Posted by brixtoncalling View Post
Kirukan, thanks for the answer.

I forgot to add a critical piece of information. Before I added the nameserver myself, resolv.conf was empty.
When resolv.conf is empty, glibc (libnss_dns.so) should query localhost. If you have a DNS server running and listening to connections on localhost, then in most cases there should be no problem.
 
1 members found this post helpful.
Old 05-25-2010, 12:39 PM   #7
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by guanx View Post
When resolv.conf is empty, glibc (libnss_dns.so) should query localhost. If you have a DNS server running and listening to connections on localhost, then in most cases there should be no problem.
Thanks guanx, that's illuminating

How "normal" is it to have a DNS service listening on 127.0.0.1? Mening "Is it part of a typical default installation?" and if so, have we not shifted the issue from resolv.conf to some other configuration file that the DNS service listening on 127.0.0.1 uses to find its upstream DNS servers?
 
Old 05-25-2010, 02:18 PM   #8
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,176

Rep: Reputation: 233Reputation: 233Reputation: 233
Quote:
Originally Posted by catkin View Post
Thanks guanx, that's illuminating

How "normal" is it to have a DNS service listening on 127.0.0.1? Mening "Is it part of a typical default installation?" and if so, have we not shifted the issue from resolv.conf to some other configuration file that the DNS service listening on 127.0.0.1 uses to find its upstream DNS servers?
I forgot what the default option was. In the last step of installation you are prompted to choose which services to activate. If bind is selected, then you have a DNS server at 127.0.0.1. A few moments after startup, bind will cache enough data to resolve host names for you.

"man resolv.conf" says "On a normally configured system this file should not be necessary. The only name server to be queried will be on the local machine".
 
Old 05-26-2010, 01:23 AM   #9
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by guanx View Post
I forgot what the default option was. In the last step of installation you are prompted to choose which services to activate. If bind is selected, then you have a DNS server at 127.0.0.1. A few moments after startup, bind will cache enough data to resolve host names for you.

"man resolv.conf" says "On a normally configured system this file should not be necessary. The only name server to be queried will be on the local machine".
Thanks guanx

I looked (netsearched and man pages) but did not find how BIND (named) could find DNS servers to use. Given that many are private I cannot imagine a method of finding them automatically. Given only a fledgling understanding I still think BIND needs some manually configured DNS server IP addresses ... ?
 
Old 05-26-2010, 02:18 AM   #10
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 231Reputation: 231Reputation: 231
The root servers used to be listed in root.hints but now you'll find it at

/var/named/caching-example/named.root

/etc/named.conf may also be configured with "forwarders" which will direct queries the specified server.
 
1 members found this post helpful.
Old 05-26-2010, 03:04 AM   #11
brixtoncalling
Member
 
Registered: Jul 2008
Location: British Columbia
Distribution: Slackware current
Posts: 403

Original Poster
Rep: Reputation: 67
Thanks for the replies. I need some time to digest everything and try out your suggestions.

For the time being, just so you know I connect using Wicd and have tried both dhcpd and dhclient with the same results. Also, I have been unable to replicate getting an empty resolv.conf. I said it was empty before, but now it appears to contain:
Code:
search Home
nameserver 192.168.1.1
To this, I must add another nameserver (for example OpenDNS or Google's) to avoid the problems in my initial post.
 
Old 05-26-2010, 03:11 AM   #12
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Thanks mRgOBLIN

Maybe this is threadjacking but, on the assumption that something like this mechanism was allowing the OP to do some name resolution with no DNS servers in resolv.conf ...

Does that mean that, in the absence of any manual configuration, the local BIND would be using the root nameservers for all queries? Or do the root nameservers hand out a list of authoritative nameservers for the whole name space? Neither of these options is attractive. In the first case, is it not bad netiquette to access the root nameservers directly? In the second case that would be a huge data transfer and most of the data transferred would not be used -- a very inefficient scenario.
 
Old 05-26-2010, 03:17 AM   #13
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by brixtoncalling View Post
To this, I must add another nameserver (for example OpenDNS or Google's) to avoid the problems in my initial post.
Only if 192.168.1.1 (your LAN/Internet router?) is not an effective DNS resolver. In the ideal case it is automatically configured with your ISP's nameservers and caches lookups thus giving you LAN speed resolution for commonly used names and ISP speed (faster than Internet speed) lookups for many of the rest ("many" meaning the ones that the ISP's nameserver(s) has/have cached).
 
Old 05-26-2010, 03:21 AM   #14
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 231Reputation: 231Reputation: 231
Assuming the local caching server was active...

If it hadn't already cached a lookup for one of the TLD's it would query the root server to find out who is authoritative for that domain.

The root server tells it who to ask for the next level and it will query that server etc.

It works it's way from the top down until it gets an answer and returns it to the client. Of course it caches much of this info.

So the work is spread among many servers and not all queries would be made to the root servers.
 
1 members found this post helpful.
Old 05-26-2010, 03:26 AM   #15
brixtoncalling
Member
 
Registered: Jul 2008
Location: British Columbia
Distribution: Slackware current
Posts: 403

Original Poster
Rep: Reputation: 67
Hi,
It makes sense that the router is somehow the problem ... but Firefox always works!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
etc/resolv.conf Problem watcher69b Linux - Newbie 2 07-17-2008 01:08 PM
DNS Hosts.conf or resolv.conf problem mac_casey SUSE / openSUSE 0 03-26-2006 09:21 AM
problem with resolv.conf roddyguk Linux - Software 8 01-18-2006 12:57 PM
Problem with resolv.conf divdude Linux - Networking 6 08-01-2005 09:43 PM
Resolv.conf problem saurya_s Linux - Software 3 01-11-2004 12:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration