LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-17-2014, 05:46 AM   #1
stimpack
LQ Newbie
 
Registered: Mar 2013
Posts: 12

Rep: Reputation: Disabled
Unhappy Squid 3.1 DNS Timeout Problem


Hi folks,
Every time i try to connect with squid proxy i got this error
Code:
The following error was encountered while trying to retrieve the URL: http://google.com/

    Unable to determine IP address from host name "google.com"

The DNS server returned:

    Refused: The name server refuses to perform the specified operation.

This means that the cache was not able to resolve the hostname presented in the URL. Check if the address is correct.

Your cache administrator is root.
I have checked squid server log and i found this :
Code:
1392635595.842  10003 41.137.74.142 TCP_MISS/404 0 CONNECT aus3.mozilla.org:443 - DIRECT/- -
1392636174.237  10002 41.137.74.142 TCP_MISS/503 4122 GET http://www.facebook.com/ - DIRECT/www.facebook.com text/CODE
1392636185.238  10471 41.137.74.142 TCP_MISS/503 4200 GET http://www.squid-cache.org/Artwork/SN.png - DIRECT/www.squid-cache.org text/CODE
1392636422.617  10003 41.137.74.142 TCP_MISS/503 4374 GET http://google.com/ - DIRECT/google.com text/CODE
1392636433.619  10699 41.137.74.142 TCP_MISS/503 4194 GET http://www.squid-cache.org/Artwork/SN.png - DIRECT/www.squid-cache.org text/CODE
1392636584.839  10004 41.137.74.142 TCP_MISS/503 4410 GET http://google.com/ - DIRECT/google.com text/CODE
1392636595.842  10449 41.137.74.142 TCP_MISS/503 4194 GET http://www.squid-cache.org/Artwork/SN.png - DIRECT/www.squid-cache.org text/CODE
squid.conf
Code:
# Recommended minimum configuration:
#
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines

acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
acl kirmi src 41.0.0.0/8
#
# Recommended minimum Access Permission configuration:
#
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager

# Deny requests to certain unsafe ports
http_access deny !Safe_ports
# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports

# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access allow localhost
http_access allow localnet
http_access allow kirmi

# And finally deny all other access to this proxy
http_access deny all

# Squid normally listens to port 3128
http_port 3128

# We recommend you to use at least the following line.
hierarchy_stoplist cgi-bin ?

# Uncomment and adjust the following to add a disk cache directory.
#cache_dir ufs /var/spool/squid 100 16 256

# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid
Any help is appreciated.

Thanks,

Last edited by stimpack; 02-17-2014 at 05:50 AM.
 
Old 02-17-2014, 06:33 AM   #2
Nephew
LQ Newbie
 
Registered: Jun 2013
Posts: 14

Rep: Reputation: Disabled
The error message tells you exactly what is wrong. Squid cannot resolve the domain.
By default Squid uses the DNS which is specified in "/etc/resolv.conf"
So check that you can do lookups on the server where squid is running. Like:
Code:
nslookup google.com
 
Old 02-17-2014, 06:48 AM   #3
stimpack
LQ Newbie
 
Registered: Mar 2013
Posts: 12

Original Poster
Rep: Reputation: Disabled
Thanks for the answer but the squid give me this error for all websites not just google..
resolv.conf
domain mediatoolsbox.us
nameserver 127.0.0.1
nameserver 216.120.250.182



Quote:
Originally Posted by Nephew View Post
The error message tells you exactly what is wrong. Squid cannot resolve the domain.
By default Squid uses the DNS which is specified in "/etc/resolv.conf"
So check that you can do lookups on the server where squid is running. Like:
Code:
nslookup google.com

Last edited by stimpack; 02-17-2014 at 06:49 AM.
 
Old 02-17-2014, 06:54 AM   #4
Nephew
LQ Newbie
 
Registered: Jun 2013
Posts: 14

Rep: Reputation: Disabled
What is the result if you open a terminal and run these 2 commands?
Code:
nslookup google.com 127.0.0.1
nslookup google.com 216.120.250.182
 
Old 02-17-2014, 06:58 AM   #5
stimpack
LQ Newbie
 
Registered: Mar 2013
Posts: 12

Original Poster
Rep: Reputation: Disabled
Server: 216.120.250.182
Address: 216.120.250.182#53

** server can't find google.com: NXDOMAIN
Quote:
Originally Posted by Nephew View Post
What is the result if you open a terminal and run these 2 commands?
Code:
nslookup google.com 127.0.0.1
nslookup google.com 216.120.250.182

Last edited by stimpack; 02-17-2014 at 07:00 AM.
 
Old 02-17-2014, 07:02 AM   #6
Nephew
LQ Newbie
 
Registered: Jun 2013
Posts: 14

Rep: Reputation: Disabled
Dude, I am gonna stop helping here if you do not answer my questions. I already went out of my way to pre-empt the problem. I asked for the result of the nslookups, but you have not posted it here. This is not a a squid issue but a most likely a DNS issue that you have.
 
Old 02-17-2014, 07:14 AM   #7
stimpack
LQ Newbie
 
Registered: Mar 2013
Posts: 12

Original Poster
Rep: Reputation: Disabled
I have posted the output of nslookup google.com 216.120.250.182
Server: 216.120.250.182
Address: 216.120.250.182#53
** server can't find google.com: NXDOMAIN


and nslookup google.com 127.0.0.1 didnt work.
what should i do about dns issue? thanks
 
Old 02-17-2014, 07:22 AM   #8
Nephew
LQ Newbie
 
Registered: Jun 2013
Posts: 14

Rep: Reputation: Disabled
Sorry missed that. So the DNS specified is not working (216.120.250.182).
Does this machine have full access to the internet? If so then change the resolve.conf file and specify the Google DNS 8.8.8.8 and/or 8.8.4.4.
You can later setup your own DNS if you want, using Bind, for example.

After editing "/etc/resolv.conf" it should look like this:
Code:
domain mediatoolsbox.us
nameserver 8.8.8.8
nameserver 8.8.4.4
Then reload Squid
Code:
squid -k reconfigure
Test again
 
Old 02-17-2014, 07:31 AM   #9
stimpack
LQ Newbie
 
Registered: Mar 2013
Posts: 12

Original Poster
Rep: Reputation: Disabled
Yes Its seems working thanks dude . Do u have any guide how to setup my own dns to use it instead of google public DNS.
 
Old 02-17-2014, 07:36 AM   #10
Nephew
LQ Newbie
 
Registered: Jun 2013
Posts: 14

Rep: Reputation: Disabled
Install Bind and sometimes running with the default configs may work. This site is excellent to learn Bind:
http://www.zytrax.com/books/dns/

To test your local DNS, you will run like:
Code:
nslookup google.com 127.0.0.1
If it works, the change the first nameserver entry in resolv.conf to:
Quote:
nameserver 127.0.0.1
 
  


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
[SOLVED] Squid 2.6 DNS Timeout Issue Avergae_joe Linux - Server 3 09-26-2011 04:17 AM
Squid dns problem rvo Linux - Server 3 02-06-2009 08:42 AM
Squid and DNS problem marius_vl Linux - Server 0 02-19-2007 10:27 AM
Squid Weirdest Problem - Timeout Palula Linux - Software 0 06-07-2006 01:17 AM
TEMP_FAILURE: DNS Error: Timeout while contacting DNS servers when receiving emails tonysutherland Linux - Networking 2 02-10-2006 09:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:44 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