LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 05-29-2009, 05:44 PM   #1
DarkAge
LQ Newbie
 
Registered: Sep 2006
Posts: 15

Rep: Reputation: 0
slow resolving of domain names


Im running centos v5.2 and during peak hours (evenings and weekends) my server resolves domainnames very slow.

This makes my webapplications slow as they send many mails which require domain name resolving (in order to find the MX records).

The value of /etc/resolv.conf contains two entries:
nameserver xxx.xxx.88.xxx
nameserver xxx.xxx.87.xxx

I assume these are used when my server tries to resolve a domainname to an IP ?

An example of dig:
Quote:
[root@server ~]# dig gmail.com

; <<>> DiG 9.3.4-P1 <<>> gmail.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35950
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 4, ADDITIONAL: 4

;; QUESTION SECTION:
;gmail.com. IN A

;; ANSWER SECTION:
gmail.com. 34 IN A 74.125.79.83
gmail.com. 34 IN A 209.85.171.83
gmail.com. 34 IN A 64.233.161.83

;; AUTHORITY SECTION:
gmail.com. 46515 IN NS ns3.google.com.
gmail.com. 46515 IN NS ns4.google.com.
gmail.com. 46515 IN NS ns1.google.com.
gmail.com. 46515 IN NS ns2.google.com.

;; ADDITIONAL SECTION:
ns1.google.com. 45671 IN A 216.239.32.10
ns2.google.com. 45671 IN A 216.239.34.10
ns3.google.com. 45671 IN A 216.239.36.10
ns4.google.com. 45671 IN A 216.239.38.10

;; Query time: 789 msec
;; SERVER: 217.112.88.90#53(217.112.88.90)
;; WHEN: Fri May 29 22:41:57 2009
;; MSG SIZE rcvd: 218

What can i do to improve the query (resolve) time as 800 msec is too slow.

Thanks in advance.
 
Old 05-29-2009, 05:51 PM   #2
jamescondron
Member
 
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 69
Are we not allowed to know which nameservers you're using? And peak times; thats perhaps your clue
 
Old 05-29-2009, 05:55 PM   #3
DarkAge
LQ Newbie
 
Registered: Sep 2006
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jamescondron View Post
Are we not allowed to know which nameservers you're using? And peak times; thats perhaps your clue
nameserver 217.112.88.90
nameserver 217.112.87.147

Don't know why i masked it out...
 
Old 05-29-2009, 06:02 PM   #4
jamescondron
Member
 
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 69
Lets try a little experiment, ping it and lets compare the times against mine, then we may be able to suss out exactly where the problem is

Code:
jc@jcmain:~$ ping 217.112.88.90
PING 217.112.88.90 (217.112.88.90) 56(84) bytes of data.
64 bytes from 217.112.88.90: icmp_seq=1 ttl=47 time=54.8 ms
64 bytes from 217.112.88.90: icmp_seq=2 ttl=47 time=42.1 ms
64 bytes from 217.112.88.90: icmp_seq=3 ttl=47 time=52.9 ms
64 bytes from 217.112.88.90: icmp_seq=4 ttl=47 time=46.0 ms
64 bytes from 217.112.88.90: icmp_seq=5 ttl=47 time=42.6 ms
64 bytes from 217.112.88.90: icmp_seq=6 ttl=47 time=38.5 ms
^C
--- 217.112.88.90 ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5020ms
rtt min/avg/max/mdev = 38.503/46.195/54.837/5.890 ms
(Yes I know this is a pretty flawed way of checking times, things change of course, but roll with it )
 
Old 05-29-2009, 06:04 PM   #5
DarkAge
LQ Newbie
 
Registered: Sep 2006
Posts: 15

Original Poster
Rep: Reputation: 0
thanks for the help.

Quote:
PING 217.112.88.90 (217.112.88.90) 56(84) bytes of data.
64 bytes from 217.112.88.90: icmp_seq=1 ttl=61 time=1.89 ms
64 bytes from 217.112.88.90: icmp_seq=2 ttl=61 time=1.84 ms
64 bytes from 217.112.88.90: icmp_seq=3 ttl=61 time=1.88 ms
64 bytes from 217.112.88.90: icmp_seq=4 ttl=61 time=1.90 ms
64 bytes from 217.112.88.90: icmp_seq=5 ttl=61 time=1.87 ms
64 bytes from 217.112.88.90: icmp_seq=6 ttl=61 time=5.56 ms
64 bytes from 217.112.88.90: icmp_seq=7 ttl=61 time=1.84 ms
64 bytes from 217.112.88.90: icmp_seq=8 ttl=61 time=1.87 ms
64 bytes from 217.112.88.90: icmp_seq=9 ttl=61 time=1.95 ms
64 bytes from 217.112.88.90: icmp_seq=10 ttl=61 time=1.85 ms

--- 217.112.88.90 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9007ms
rtt min/avg/max/mdev = 1.840/2.248/5.564/1.106 ms
 
Old 05-29-2009, 06:12 PM   #6
jamescondron
Member
 
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 69
Oh, you're actually behind it at PoundHost? Sorry, that was slow of me. Okay, lets compare elsewhere- we should get similar times for google geographically:

Code:
jc@jcmain:~$ ping 209.85.171.100
PING 209.85.171.100 (209.85.171.100) 56(84) bytes of data.
64 bytes from 209.85.171.100: icmp_seq=1 ttl=234 time=250 ms
64 bytes from 209.85.171.100: icmp_seq=2 ttl=234 time=378 ms
64 bytes from 209.85.171.100: icmp_seq=3 ttl=234 time=191 ms
64 bytes from 209.85.171.100: icmp_seq=4 ttl=234 time=197 ms
64 bytes from 209.85.171.100: icmp_seq=5 ttl=234 time=200 ms
64 bytes from 209.85.171.100: icmp_seq=6 ttl=234 time=332 ms
64 bytes from 209.85.171.100: icmp_seq=7 ttl=234 time=195 ms
^C
--- 209.85.171.100 ping statistics ---
7 packets transmitted, 7 received, 0% packet loss, time 6022ms
rtt min/avg/max/mdev = 191.393/249.540/378.370/70.475 ms
(This is over 24 hops for me)
 
Old 05-29-2009, 06:15 PM   #7
DarkAge
LQ Newbie
 
Registered: Sep 2006
Posts: 15

Original Poster
Rep: Reputation: 0
ping
Quote:
PING 209.85.171.100 (209.85.171.100) 56(84) bytes of data.
64 bytes from 209.85.171.100: icmp_seq=1 ttl=242 time=153 ms
64 bytes from 209.85.171.100: icmp_seq=2 ttl=242 time=158 ms
64 bytes from 209.85.171.100: icmp_seq=3 ttl=242 time=167 ms
64 bytes from 209.85.171.100: icmp_seq=4 ttl=242 time=164 ms
64 bytes from 209.85.171.100: icmp_seq=5 ttl=242 time=154 ms
64 bytes from 209.85.171.100: icmp_seq=6 ttl=242 time=153 ms
64 bytes from 209.85.171.100: icmp_seq=7 ttl=242 time=157 ms
64 bytes from 209.85.171.100: icmp_seq=8 ttl=242 time=164 ms
64 bytes from 209.85.171.100: icmp_seq=9 ttl=242 time=164 ms

--- 209.85.171.100 ping statistics ---
9 packets transmitted, 9 received, 0% packet loss, time 8006ms
rtt min/avg/max/mdev = 153.235/159.829/167.885/5.264 ms
and traceroute
Quote:
traceroute to 209.85.171.100 (209.85.171.100), 30 hops max, 40 byte packets
1 preston.eukhost.com (92.48.74.79) 0.064 ms 0.036 ms 0.010 ms
2 pri.the-bsq3.as29550.net (217.112.81.89) 1.039 ms 1.085 ms 1.134 ms
3 195.66.224.125 (195.66.224.125) 1.253 ms 1.248 ms 1.305 ms
4 209.85.252.42 (209.85.252.42) 7.525 ms 7.653 ms 7.762 ms
5 216.239.43.192 (216.239.43.192) 73.215 ms 73.212 ms 73.251 ms
6 216.239.46.14 (216.239.46.14) 116.572 ms 116.583 ms 116.604 ms
7 72.14.233.116 (72.14.233.116) 143.767 ms 143.675 ms 143.638 ms
8 216.239.46.208 (216.239.46.208) 154.195 ms 154.199 ms 152.898 ms
9 64.233.174.125 (64.233.174.125) 192.425 ms 64.233.174.127 (64.233.174.127) 155.463 ms 155.504 ms
10 209.85.251.133 (209.85.251.133) 164.070 ms 209.85.251.141 (209.85.251.141) 166.103 ms 209.85.251.125 (209.85.251.125) 174.822 ms
11 74.125.31.130 (74.125.31.130) 162.599 ms * 74.125.31.6 (74.125.31.6) 167.110 ms
12 * * *
13 * cg-in-f100.google.com (209.85.171.100) 158.286 ms 157.736 ms
 
Old 05-29-2009, 06:16 PM   #8
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,516

Rep: Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896
Quote:
during peak hours (evenings and weekends) my server resolves domainnames very slow.
Seems to me the server can't handle all the requests

You could try to use a different dns server
These are from open dns

Quote:
208.67.222.222
208.67.220.220
Or you could install bind9 or dnsmasq.


ipv6 tends to slow down dns lookups
try to disable ipv6

Last edited by repo; 05-29-2009 at 06:19 PM.
 
Old 05-29-2009, 06:18 PM   #9
DarkAge
LQ Newbie
 
Registered: Sep 2006
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by repo View Post
Seems to me the server can't handle all the requests
My server performs fine. As long as I dont send mails out its superfast.
Quote:
Originally Posted by repo View Post
You could try to use a different dns server
These are from open dns



Or you could install bind9 or dnsmasq.
Can i switch name servers in my resolv.conf file without any issues ?
 
Old 05-29-2009, 06:20 PM   #10
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,516

Rep: Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896
Quote:
Can i switch name servers in my resolv.conf file without any issues ?
yes, just comment out the old ones
 
Old 05-29-2009, 06:23 PM   #11
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,516

Rep: Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896
Quote:
My server performs fine. As long as I dont send mails out its superfast.
I was talking about the dns server
 
  


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
Issues Resolving Domain Names whc Linux - Server 6 03-13-2008 05:28 PM
Dapper Install Delays Resolving Domain Names RAdams Ubuntu 5 08-28-2006 10:35 AM
Slow resoution of domain names lithiumfx Linux - Networking 13 07-27-2005 07:09 PM
NetBIOS names not resolving Xhalman Linux - Networking 0 02-16-2004 03:38 PM
Mandrake 9.1 not resolving domain names erikbennett Mandriva 2 10-06-2003 05:50 PM


All times are GMT -5. The time now is 03:17 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration