友情提示:欢迎光临!本地已启用二维码api网关,地址是https://api.slogra.com

python将gfwlist转换成dnsmasq规则

post by rocdk890 / 2016-3-14 14:41 Monday linux技术

  当使用openwrt时,大家选择fq工具一定是ss,如果你是使用的石像鬼的固件的话,那可以不用看这篇文章了,如果是使用官方默认openwrt或者 明月的openwrt的话,那么下面这个东西会为你带来惊喜,其实也就是用python转换gfwlist为dnsmasq规则.
  需要的软件:python 2.6

脚本内容:
cat dnsmasq-gfwlist.py

#!/usr/bin/env python 
#coding=utf-8
# 
# Generate a list of dnsmasq rules with ipset for gfwlist
# 
# Copyright (C) 2014 http://www.shuyz.com  
# Ref https://code.google.com/p/autoproxy-gfwlist/wiki/Rules   
 
import urllib2
import re
import os...

阅读全文>>

标签: dnsmasq 规则 转换 python openwrt gfw gfwlist

评论(0) 引用(0) 浏览(7426)

本地用dnsmasq搭建dns缓存服务器

post by rocdk890 / 2011-6-12 20:18 Sunday linux技术

 已经研究过bind的缓存dns服务器,今天研究下了dnsmasq的dns缓存,发现dnsmasq的配置上要简单得多,比bind上复杂的配置要让新手好上手些,毕竟是本地用太麻烦以后不好维护.好了,看操作吧.
 
 系统:centos 5.4
 ip:192.168.1.166
 需要的软件:dnsmasq
 
1.安装dnsmasq(centos可以直接用yum安装,或者直接在光盘里找)
yum -y install Dnsmasq

2.配置
cp /etc/dnsmasq.conf /etc/dnsmasq.conf.bak
vi /etc/dnsmasq.conf

dnsmasq.conf里的内容:
#找到
#resolv-file=
#改为
resolv-file=/etc/resolv.dnsmasq.conf
保存退出后
cp /etc/resolv.conf /etc/resolv.dnsmasq.conf

阅读全文>>

标签: dns缓存 dnsmasq

评论(0) 引用(0) 浏览(22998)