LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 08-19-2004, 06:26 PM   #1
essdeeay
Member
 
Registered: Aug 2004
Location: United Kingdom
Distribution: Gentoo, FC5
Posts: 87

Rep: Reputation: 15
Question Local caching only DNS takes a long time to resolve


Hello everybody, this is my first post here - and I'm pretty much a linux newbie.

- Fedora core 2

Background

More for proof of concept than anything else, I would like to set up DNS caching so it will serve the LAN (currently only 2 machines) in the hope that it may improve performance slightly.

DNS configuration

(/etc/resolv.conf)
Code:
nameserver 127.0.0.1
(/etc/named.conf)
Code:
// generated by named-bootconf.pl

options {
	forwarders {
		212.23.8.1;
		212.23.8.6;
	};
	directory "/var/named";
	/*
	 * If there is a firewall between you and nameservers you want
	 * to talk to, you might need to uncomment the query-source
	 * directive below.  Previous versions of BIND always asked
	 * questions using port 53, but BIND 8.1 uses an unprivileged
	 * port by default.
	 */
	// query-source address * port 53;
};

// 
// a caching only nameserver config
// 
controls {
	inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
zone "." IN {
	type hint;
	file "named.ca";
};

zone "localhost" IN {
	type master;
	file "localhost.zone";
	allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
	type master;
	file "named.local";
	allow-update { none; };
};

include "/etc/rndc.key";
The TEST

I run NSLOOKUP, type 'server' to verify it's checking 127.0.0.1 then type any hostname on the internet it takes at least 1.5 seconds to resolve, sometimes longer.

If I type 'server 212.23.8.1' (my ISP primary DNS, and listed as first forwarder in named.conf) then type different hostnames on the internet it responds immediately.

The Question

What havn't I done, or what have I done wrong which makes using local DNS as caching only so sloooow.

Many thanks in advance,
Steve
 
Old 08-20-2004, 06:25 AM   #2
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
Greetings essdeeay,

Try adding the nameservers to /etc/resolv.conf

For example...

search mydomain.com
nameserver 212.23.8.1
nameserver 212.23.8.6
nameserver 127.0.0.1
 
Old 08-20-2004, 10:07 AM   #3
essdeeay
Member
 
Registered: Aug 2004
Location: United Kingdom
Distribution: Gentoo, FC5
Posts: 87

Original Poster
Rep: Reputation: 15
Thanks for the answer homey. I'm sure this would work, but what I'm trying to do is force the use of the local DNS server and let it forward to the ISPs servers - my thinking is, the local DNS cache will build up and it will be slightly faster resolving DNS for LAN machines.

I've played around with a few things...

If local DNS can resolve, it responds in 2ms. If local DNS can't resolve, it goes to root and takes 600ms (which is not what I want).

I would like it to go to ISP servers for a 30ms response time instead, hence the 2 forwarders specified in named.conf. However, it isn't doing this and this is the problem.

So I guess my 2 questions are:

a) What should the behaviour be?
b) How do I put it right?

Many thanks again,
Steve

Last edited by essdeeay; 08-20-2004 at 10:09 AM.
 
Old 08-20-2004, 10:28 AM   #4
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
I guess I don't know how you should proceed then but that's how I do it and the time seems ok to me.

PING monster.com (63.121.29.1) 56(84) bytes of data.
64 bytes from www.in.monster.com (63.121.29.1): icmp_seq=0 ttl=118 time=25.9 ms
64 bytes from www.in.monster.com (63.121.29.1): icmp_seq=1 ttl=118 time=24.7 ms
64 bytes from www.in.monster.com (63.121.29.1): icmp_seq=2 ttl=118 time=24.0 ms


Edit: Actually, I only have my server listed in /etc/resolv.conf

search mydomain.com
nameserver 192.168.0.1

and the forwards are in the /etc/named.custom

Last edited by homey; 08-20-2004 at 10:33 AM.
 
Old 08-20-2004, 11:41 AM   #5
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 69
I'm wondering if the '.' zone should really be there? If you're forwarding all queries to your ISP that can't immediately be answered from your cache, then I don't see any reason why your name server would need to know how to find the root servers.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
login takes long time doorman007 Linux - Software 2 04-25-2005 12:56 AM
Connecting to local ProFTPD takes a long time Dee-ehn Linux - Networking 3 12-07-2004 12:58 AM
External Domain Resolve takes long LinuxLeo Linux - Networking 3 05-02-2004 11:03 PM
takes a long delay to resolve name Kocil Linux - Networking 2 03-11-2003 09:09 AM
HELP! Caching DNS server wont resolve .EDU domains? spadesmaster Linux - Networking 0 04-30-2002 10:25 AM


All times are GMT -5. The time now is 09:16 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration