Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Remembering host resolution automatically?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
OdinsDream
Veteran
Veteran


Joined: 01 Jun 2002
Posts: 1057

PostPosted: Sun Jul 06, 2003 7:33 pm    Post subject: Remembering host resolution automatically? Reply with quote

It seems I see "Resolving host: www.whatever.com" all too often in the bottom of my browser, even if I'm clicking a link on a page that leads only to another area of the page. I have no idea why, but my DNS resolution is particularly slow at home, and I'd like to minimize the number of times it's done.

Can I set up some service on gentoo to cache these DNS resolution requests? I'd like to be able to store my frequently visited sites, and not have to do it manually through /etc/hosts.
_________________
s/(?<!gnu\/)linux(?! kernel)/GNU\/Linux/gi

Don't blame me. I didn't vote for him.

http://john.simplykiwi.com
Back to top
View user's profile Send private message
BackSeat
Apprentice
Apprentice


Joined: 12 Apr 2002
Posts: 242
Location: Reading, UK

PostPosted: Sun Jul 06, 2003 10:50 pm    Post subject: Reply with quote

emerge djbdns and then run dnscache-setup

BS
Back to top
View user's profile Send private message
OdinsDream
Veteran
Veteran


Joined: 01 Jun 2002
Posts: 1057

PostPosted: Mon Jul 07, 2003 12:58 am    Post subject: Reply with quote

Many thanks! I've a quick question, though. At the end of the last step, it prompts me to ensure that daemontools is running. I've tried my best to figure out where this happens, but it doesn't have an entry for rc-update to handle.

What about that part of the directions?

Hm, the program also seems to have just crashed. Otherwise, it had been working speedily well. How can i restart it, or have it restart by itself?
_________________
s/(?<!gnu\/)linux(?! kernel)/GNU\/Linux/gi

Don't blame me. I didn't vote for him.

http://john.simplykiwi.com
Back to top
View user's profile Send private message
BackSeat
Apprentice
Apprentice


Joined: 12 Apr 2002
Posts: 242
Location: Reading, UK

PostPosted: Mon Jul 07, 2003 7:38 am    Post subject: Reply with quote

Yes, that is a bit confusing. To have daemontools start at boot:
Code:
rc-update add svscan default
This will make sure the services for djbdns are running, and will restart them if they stop.

BS
Back to top
View user's profile Send private message
OdinsDream
Veteran
Veteran


Joined: 01 Jun 2002
Posts: 1057

PostPosted: Tue Jul 08, 2003 12:40 am    Post subject: Reply with quote

djbdns was working splendidly for awhile last night, and when it crashed, I posted that previous message. I set up svscan to run at boot, and started that service up.

I can see that djbdns is running, but I'm failing to get any addresses resolved. I checked the log file, and I see many, many of these:

Code:

@400000003f0a0e9f118947dc dnscache: fatal: unable to bind UDP socket: address already used

_________________
s/(?<!gnu\/)linux(?! kernel)/GNU\/Linux/gi

Don't blame me. I didn't vote for him.

http://john.simplykiwi.com
Back to top
View user's profile Send private message
BackSeat
Apprentice
Apprentice


Joined: 12 Apr 2002
Posts: 242
Location: Reading, UK

PostPosted: Tue Jul 08, 2003 7:08 am    Post subject: Reply with quote

Can you confirm that you are NOT running tinydns, but only dnscache? (What is the output of 'ls /service'?)

Also, when you say that djbdns "crashed", what exactly do you mean?

BS
Back to top
View user's profile Send private message
OdinsDream
Veteran
Veteran


Joined: 01 Jun 2002
Posts: 1057

PostPosted: Tue Jul 08, 2003 10:04 pm    Post subject: Reply with quote

BackSeat wrote:
Can you confirm that you are NOT running tinydns, but only dnscache? (What is the output of 'ls /service'?)

Also, when you say that djbdns "crashed", what exactly do you mean?

BS


This is my first foray into DNS services, so dnscache is currently all I have under /service. I also had not installed svscan prior to this. I suppose crash was a bit harsh. The program was still running, it had just sporadically stopped resolving hosts. I noticed it by clicking on a link, and having the webbrowser hang on resolving...and finally come back to tell me it could not resolve the hostname (this wasn't something obscure.. I had just moved from one section to another in these forums).

So, that's the problem. Upon investigating the log, I found those entries.

I'm running this computer on a private home network, with IP addresses in the 192.168.2.0 range. Each computer gets it address via the DHCP server that doubles as my wireless base station and router. It, in turn, gets a public IP address via DHCP from my ISP.
_________________
s/(?<!gnu\/)linux(?! kernel)/GNU\/Linux/gi

Don't blame me. I didn't vote for him.

http://john.simplykiwi.com
Back to top
View user's profile Send private message
BackSeat
Apprentice
Apprentice


Joined: 12 Apr 2002
Posts: 242
Location: Reading, UK

PostPosted: Tue Jul 08, 2003 10:14 pm    Post subject: Reply with quote

Ah, you're using DHCP. I suspect your /etc/resolv.conf file has been overwritten after you configured dnscache. Edit your /etc/conf.d/net file and ensure that the interface has the "-R" option, which will prevent your /etc/resolv.conf being overwritten:
Code:
dhcpcd_eth0=" -R "
Then edit /etc/resolv.conf and make sure the address in there is 127.0.0.1.

Let me know how you get on.

BS
Back to top
View user's profile Send private message
OdinsDream
Veteran
Veteran


Joined: 01 Jun 2002
Posts: 1057

PostPosted: Wed Jul 09, 2003 12:41 am    Post subject: Reply with quote

BackSeat wrote:
Ah, you're using DHCP. I suspect your /etc/resolv.conf file has been overwritten after you configured dnscache. Edit your /etc/conf.d/net file and ensure that the interface has the "-R" option, which will prevent your /etc/resolv.conf being overwritten:
Code:
dhcpcd_eth0=" -R "
Then edit /etc/resolv.conf and make sure the address in there is 127.0.0.1.

Let me know how you get on.

BS


I will try your suggestion.

However, these problems crop up a few minutes after I finish running dnscache-setup, and to fix it, I go into /etc/resolv.conf (which has 127.0.0.1 in it, placed there by dnscache) and I modify it to point to my actual nameservers.

So, this file is still as it should be. Anything else I can look for? I'll go try restarting the interface with the -R option, now.

Edit:

Okay. I added the -R option. Unfortunately, this didn't resolve the issue. I left the resolv.conf pointing to 127.0.0.1, and then I entered a search term in google. It gave me some results. I clicked the first one, and DNS resolution failed.

Pop over to a console... dnsq a www.google.com 127.0.0.1 times out. Yet, dnsq a www.google.com 192.168.2.1 returns immediately with results.

I then did /etc/init.d/svscan restart and tried dnsq a www.google.com 127.0.0.1 again. It worked! I tried some more google results, and it soon failed again.
_________________
s/(?<!gnu\/)linux(?! kernel)/GNU\/Linux/gi

Don't blame me. I didn't vote for him.

http://john.simplykiwi.com
Back to top
View user's profile Send private message
BackSeat
Apprentice
Apprentice


Joined: 12 Apr 2002
Posts: 242
Location: Reading, UK

PostPosted: Wed Jul 09, 2003 6:42 am    Post subject: Reply with quote

You did enter 192.168.2.1 as the forward address when you ran dnscache-setup, didn't you?

BS
Back to top
View user's profile Send private message
OdinsDream
Veteran
Veteran


Joined: 01 Jun 2002
Posts: 1057

PostPosted: Wed Jul 09, 2003 1:17 pm    Post subject: Reply with quote

BackSeat wrote:
You did enter 192.168.2.1 as the forward address when you ran dnscache-setup, didn't you?

BS


Sure did. I also tried the DNS servers themselves. Both ways have the result described.
_________________
s/(?<!gnu\/)linux(?! kernel)/GNU\/Linux/gi

Don't blame me. I didn't vote for him.

http://john.simplykiwi.com
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum