LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1546|回复: 3

用Squid建Proxy时的域名无法解析的问题,请大虾帮忙

[复制链接]
发表于 2006-11-9 10:12:42 | 显示全部楼层 |阅读模式
我是新学Linux的菜鸟,最近用Squid建代理时遇到个问题:
在Squid里已经设置好dns_nameservers的地址了,而且代理服务器上网也没问题,但在客户端看某些网页时就会出现域名无法解析的问题,比如下面
The requested URL could not be retrieved

--------------------------------------------------------------------------------

While trying to retrieve the URL: http://www.baidu.com/s?

The following error was encountered:

Unable to determine IP address from host name for www.baidu.com
The dnsserver returned:

No DNS records
This means that:

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

但有些网站直接输入域名是可以看的,像Baidu能打开但一搜索就出现上面的问题,请教各位高人,是配置文件什么地方需要修改还是别的什么问题啊?小弟在这里谢谢了
发表于 2006-11-9 14:33:03 | 显示全部楼层
你是Baidu我是Google,我把换过代理,好像Baidu,Google这样的网站使用代理容易出问题。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-11-13 17:14:08 | 显示全部楼层
谢谢这位仁兄。
现在问题已经解决了,是Never_direct语句没有写造成的,具体原因还不太明白,希望有人帮忙解答。
回复 支持 反对

使用道具 举报

发表于 2006-11-14 08:54:47 | 显示全部楼层
Tag Name          never_direct
Usage         never_direct allow|deny [!]aclname ...

Description
never_direct is the opposite of always_direct. Please read the description for always_direct if you have not already.

With 'never_direct' you can use ACL elements to specify requests, which should NEVER be forwarded directly to origin servers

When always_direct and never_direct are deny (By default), Squid selects based on the request type and a number of other factors if a parent should be used or not, and if a parent could not be reached it will always fallback on direct.

If always_direct is allow then Squid will always go direct to the source without considering any peers.

If never_direct is allow then Squid will never attempt to go direct to the source. Instead it tries very hard to find a parent to send the request to. If no parent can be found then an error is returned. For Further reference on never_direct, please click here.
Default         never_direct is by default deny.

Example
For example, to force the use of a proxy for all requests, except those in your local domain use something like:

acl local-servers dstdomain foo.net
acl all src 0.0.0.0/0.0.0.0
never_direct deny local-servers
never_direct allow all

or if squid is inside a firewall and there are local intranet servers inside the firewall then use something like:

acl local-intranet dstdomain .foo.net
acl local-external dstdomain .external.foo.net
always_direct deny local-external
always_direct allow local-intranet
never_direct allow all

Caution
It will be better to understand always_direct before enabling this tag

原来官网上有,只是我们没仔细看,不过默认就是deny呀?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表