回家后,用上了那个WRT54G,上了ddwrt+chnroutes+DNSMASQ不能用交大的isatap隧道了,不过Teredo隧道又可以正常稳定的使用,但是发现一些奇怪的问题,比如,使用nslookup可以解析到ipv6.google.com,但是ping,一直提示“Ping request could not find host ipv6.google.com. Please check the name and try again.” 无法解析域名。但是直接ping google的IPV6地址确实是通的。证明IPV6链路正常。
一开始以为是其他隧道的干扰,关闭了其他隧道,还是老样子.而且使用gogo6的Tunnel broker也这样。放Google搜索了半天,找到了这个解释 微软脑残:
http://ipv6-or-no-ipv6.blogspot.com/2009/02/teredo-ipv6-on-vista-no-aaaa-resolving.html
Vista doesn't look up AAAA at all when it's on Teredo. It's intended behavior -- stupid, perhaps, but it's intended. See http://technet.microsoft.com/en-us/library/bb727035.aspx for all the details.
解决方................阅读全文
PHPQuery是一个PHP的Jquery实现,对于熟悉jQuery的人来说,可以非常方便的机进行网页解析。可是对畸形怪状的网页和编码支持不是太好,虽然有各种hack方式,但是始终很麻烦,而且从2009年以后就不怎么更新了。于是找替代方案,找到了这个Simple_Html_Dom,文档也很详细,立刻用这奇形怪状的网页进行了测试。
<?php
//演示
header("Content-type: text/html; charset=utf-8");
set_time_limit(0);
include ("simple_html_dom.php");
$url = 'http://ihipop.info';
$html = file_get_html($url);
echo $html -> find('title', 0) -> plaintext;
$x = $html -> find('a[rel=bookmark]');
foreach($x as $key => $value) {
echo '<br />';
echo $value -> plaintext;
}
$html -> clear();
//内存释放
?>
<?php
//演示
header("Content-type: text/html; charset=euc-jp");
set_time_................阅读全文
安装dnsmasq后需要进行一些配置才能使用
简单配置
vim /etc/dnsmasq.conf
#找到
#resolv-file=
#改为
resolv-file=/etc/resolv.dnsmasq.conf
cp /etc/resolv.conf /etc/resolv.dnsmasq.conf
#编辑/etc/resolv.dnsmasq.conf,确保符合DNS配置文件的常见格式(在里面指定转发到DNS服务器)
#修改/etc/resolv.conf
#改为本机DNS
nameserver 127.0.0.1
完成后重启dnsmasq即可
使用更加合理的配置
DNSMASQ最大的好处的轻量。灵活,可以针对不同的域名选择不同的上层DNS来解析。
比如我的一台电信专线的VPN服务器老打不开某国内SNS网站(不想提名字),用nslookup检查后发现被解析到了天津联通的一个负载均衡点。打不开是必然了。
那么可以使用DNSMASQ来解决这个问题,常规站点使用/etc/resolv.dnsmasq.conf指定的DNS服务器来解析,特殊站点使用自己制定的其他DNS服务器来解析。
首先注释掉文件最后一行的conf-dir=/etc/dnsmasq.d
mkdir /etc/dnsmasq.d
cd /etc/dnsmas................阅读全文
近期评论