前面写过一篇帖子,是关于用dnsmasq做dns缓存的,里面提到的dsl部分采用的是注释掉usepeerdns,这并不是很好用,因为无法获取运营商的dns server
简单的做法是在/etc/ppp/ip-up.d/0000usepeerdns里cat /etc/ppp/resolv.conf前加上一句echo “nameserver 127.0.0.1″ 把那一段变成这样即可。

# merge the new nameservers with the other options from the old configuration
{
  echo "nameserver 127.0.0.1"
  cat /etc/ppp/resolv.conf
  grep --invert-match '^nameserver[[:space:]]' "$REALRESOLVCONF" || true
} > "$REALRESOLVCONF.tmp"