GithubHelp home page GithubHelp logo

gowinder / gfwlist2dnsmasq Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cokebar/gfwlist2dnsmasq_python

0.0 2.0 0.0 49 KB

Just another script to auto-generate dnsmasq ipset rules using gfwlist

License: GNU General Public License v2.0

Python 100.00%

gfwlist2dnsmasq's Introduction

gfwlist2dnsmasq

Intro

Just another script to auto-generate dnsmasq ipset rules using gfwlist

Notification: Need python2, do not use python3

GFWList is composed by regular expressions, but dnsmasq rules is formed by domain names. So the conversion from GFWList to dnsmasq rule list is not a equivalent conversion. You might need to add extra rules or modify some converted rules.

Using:

Modify gfwlist2dnsmasq.py:

Change this to your DNS server IP&port:

mydnsip = '127.0.0.1'
mydnsport = '5353'

Change this to your ipset name:

ipsetname = 'gfwlist'

Path to save you rule file:

rulefile = './dnsmasq_list.conf'

Add your own extra domain here. One domain in a line. eg:

EX_DOMAIN=[ \
'.google.com', \
'.google.com.hk', \
'.google.com.tw', \
'.google.com.sg', \
'.google.co.jp', \
'.google.co.kr', \
'.blogspot.com', \
'.blogspot.sg', \
'.blogspot.hk', \
'.blogspot.jp', \
'.blogspot.kr', \
'.gvt1.com', \
'.gvt2.com', \
'.gvt3.com', \
'.1e100.net', \
'.blogspot.tw' \
]

Then run gfwlist2dnsmasq.py:

python gfwlist2dnsmasq.py

If you don't want to generate the rules by yourself, you can download the rule file from:

https://github.com/cokebar/gfwlist2dnsmasq/releases

Known bugs:

  1. Invalid lines at the beginning of the list (This script only do with domain address, but gfwlist contains IP addresses):
server=/.85.17.73.31/127.0.0.1#5353
ipset=/.85.17.73.31/gfwlist

How to fix: just delete these lines.

gfwlist2dnsmasq's People

Contributors

cokebar avatar kkzxak47 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.