Chinese-specific configuration to improve your favorite DNS server

Overview

dnsmasq-china-list

Chinese-specific configuration to improve your favorite DNS server. Best partner for chnroutes.

  • Improve resolve speed for Chinese domains.

  • Get the best CDN node near you whenever possible, but don't compromise foreign CDN results so you also get best CDN node for your VPN at the same time.

  • Block ISP ads on NXDOMAIN result (like 114so).

Details

  • accelerated-domains.china.conf: General domains to be accelerated.

    These domains have a better resolving speed and/or result when using a Chinese DNS server.

    To determine if a domain is eligible, one of the criteria below must be met:

  • The domain's NS server is located in China mainland.

  • The domain will resolve to an IP located in China mainland when using a Chinese DNS server, but not always do when using a foreign DNS server (For example, CDN accelerated sites that have node in China). This however does not include those having node near China mainland, like in Japan, Hong Kong, Taiwan, etc.

Please don't add subdomains if the top domain is already in the list. This includes all .cn domains which are already matched by the /cn/ rule.

  • google.china.conf: Google domains to be accelerated.

    These domains are resolved to Google China servers when using a Chinese DNS. In most conditions this will yield better page load time for sites using Google's web services, e.g. Google Web Fonts and AdSense.

    Bear in mind that they are not considered stable. Use at your own risk.

  • apple.china.conf: Apple domains to be accelerated.

    Some ISPs (often smaller ones) have problem accessing Apple's assets using their China mainland CDN servers. Please consider remove this file if that happens to you. See #156 for some more info.

  • bogus-nxdomain.china.conf: Known addresses that are hijacking NXDOMAIN results returned by DNS servers.

Usage

Automatic Installation (recommended)

  1. Fetch the installer from github (or a mirror): wget https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/install.sh
  2. (Optional) Edit it to use your favorite DNS server and/or another mirror to download the list.
  3. Run it as root: sudo ./install.sh

You can save the installer and run it again to update the list regularly.

Manual Installation

  1. Place accelerated-domains.china.conf, bogus-nxdomain.china.conf (and optionally google.china.conf, apple.china.conf) under /etc/dnsmasq.d/ (Create the folder if it does not exist).
  2. Uncomment "conf-dir=/etc/dnsmasq.d" in /etc/dnsmasq.conf
  3. (Optional) Place dnsmasq-update-china-list into /usr/bin/
  4. (Optional) Make custom DNS server configuration and/or other services' configuration.
# change the default DNS server to 202.96.128.86
make SERVER=202.96.128.86 dnsmasq
# generate unbound's configuration
make unbound
# generate bind's configuration
make bind
# full example of generating dnscrypt-proxy forwarding rules for Windows
make SERVER=101.6.6.6 NEWLINE=DOS dnscrypt-proxy

License

Copyright © 2015 Felix Yan 
   
    
This work is free. You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See the LICENSE file for more details.

   
Comments
  • 114DNS's `edns-client-subnet` is broken.

    114DNS's `edns-client-subnet` is broken.

    ; «» DiG 9.9.3 «» @8.8.8.8 115.com +client=59.172.176.0/24
    ; (1 server found)
    ;; global options: +cmd
    ;; Got answer:
    ;; -»HEADER«- opcode: QUERY, status: NOERROR, id: 12931
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 512
    ; CLIENT-SUBNET: 59.172.176.0/24/0
    ;; QUESTION SECTION:
    ;115.com.                       IN      A
    
    ;; ANSWER SECTION:
    115.com.                287     IN      A       119.147.156.111
    115.com.                287     IN      A       119.147.156.108
    
    ;; Query time: 107 msec
    ;; SERVER: 8.8.8.8#53(8.8.8.8)
    ;; WHEN: Mon Nov 16 23:37:36 CST 2015
    ;; MSG SIZE  rcvd: 79
    

    AND we have

    ; «» DiG 9.9.3 «» @114.114.114.114 115.com +client=59.172.176.0/24
    ; (1 server found)
    ;; global options: +cmd
    ;; Got answer:
    ;; -»HEADER«- opcode: QUERY, status: NOERROR, id: 40924
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 4096
    ; CLIENT-SUBNET: 59.172.176.0/24/0
    ;; QUESTION SECTION:
    ;115.com.                       IN      A
    
    ;; ANSWER SECTION:
    115.com.                30      IN      A       58.253.94.246
    115.com.                30      IN      A       58.253.94.249
    
    ;; Query time: 48 msec
    ;; SERVER: 114.114.114.114#53(114.114.114.114)
    ;; WHEN: Mon Nov 16 23:42:47 CST 2015
    ;; MSG SIZE  rcvd: 79
    

    114DNS does support CLIENT-SUBNET header. However, it only returns with answers judged by requestor's IP rather than specified CLIENT-SUBNET IP. This would give bad routes from internal CDNs, which mainly limits U/D speed from various media streaming providers. At the same time, AliDNS is okay.

    You can do some more tests by specifying different ISP's IP though. Consider replacing default 114DNS.

    opened by legendtang 26
  • 列表里面有一些不是必需的项目

    列表里面有一些不是必需的项目

    目前列表变得越来越大, 在普通路由器上较难加载了. 简单看了列表里面新增的一些域名, 有一部分是无需添加进本列表的: 例如tbsandbox.com. 其标志为:该域名的DNS请求未区分国籍, 全球任意DNS服务器解析出来的结果都是同一个/同一组. 建议此类型的域名不再添加进列表, 以增强列表质量.

    opened by liyvhg 17
  • 对目前列表的补充

    对目前列表的补充

    我不太确定怎样才是比较合适的提交更新的方式。

    这是我对目前列表的补充,检测的方式是根据是否使用了中国的dns accelerated-domains-20160203.china.conf.zip

    我使用的检测代码: https://github.com/tomasen/dnsmasq-china-list

    opened by tomasen 17
  • 我使用列表后为什么不能访问国内网站呢?

    我使用列表后为什么不能访问国内网站呢?

    我使用dnsmasq+dnscrypt, dnsmasq的配置文件内容:

    no-resolv
    no-poll
    no-hosts
    interface=wlan0
    #no-dhcp-interface=wlan0
    server=127.0.2.1#5353
    cache-size=4096
    conf-dir=/etc/dnsmasq.d
    

    列表的两个文件已经保存到/etc/dnsmasq.d

    pi@raspberrypi:/etc/dnsmasq.d $ ls
    accelerated-domains.china.conf  bogus-nxdomain.china.conf  README
    

    但是不能访问国内网站,却能访问twitter和github,大家知道为什么吗?

    opened by polinzhuo 9
  • domain list request

    domain list request

    因为pull requests失败,没办法只好发到issue里了,两个需求请大神您考虑下能不能提供这样的list: 1)纯域名的list,就是“example.com”格式的列表,因为114那个dns延迟比较高(差不多是我这里的运营商提供的DNS的10倍),每次用这个列表,还得剥离多余的参数再加运营商的DNS。 2)另外还有个需求:能否提供个精简版的域名列表,能涵盖alexa top 500这个级别的国内域名就行,最好加上那些对应的cdn域名控制在1000个以内,因为这基本上能满足绝大多数人使用了,太多用不上反而影响系统运行效率。

    opened by angusding 8
  • Remove jakting.com

    Remove jakting.com

    https://github.com/felixonmars/dnsmasq-china-list/commit/6ef903c5647a888079bd3ae863f5b1da5e28ddb6

    For the purpose of protecting IP, I have used CloudFlare for it, resulting in poor access speed of its direct connection in China.

    opened by TigerBeanst 7
  • 希望能对现有列表条目的有效性进行周期性验证

    希望能对现有列表条目的有效性进行周期性验证

    很多域名的 nameserver 会不断改变,也许就不再是国内的,可能会导致域名无法正常访问。

    鉴于引用此仓库的地方太多,是否有对整个列表进行周期性的验证?如果没有,能否增加这一过程?

    补个之前的,开了个 issues #223 ,单纯就是想问一下如何收集域名本身,也就是原始的域名数据来源,并非是如何建立本仓库的教学。 我不知道该从何处可以获得网络上最新的、可用的、较为齐全的域名列表,希望能解答下,给个思路也行。 谢谢了!

    opened by SeaHOH 7
  • 列表拆分

    列表拆分

    可否把 仅国内的内容提供商国内可访问的国外内容提供商 的域名拆分为不同文件

    仅国内的内容提供商 列表只要做到 国内域名国内解析国内cdn国内解析 即可 这样既可以缩减列表数量保持可靠性又能避免混合 国内可访问的国外内容提供商 导致的cdn分配问题

    比如现有列表的 client-download.steampowered.com 就是一个明显的例子 在使用代理的情况下这个域名依然会被通过, 导致使用代理去访问国内的节点

    opened by muink 6
  • usage of dnsmasq-china-list & pdnsq

    usage of dnsmasq-china-list & pdnsq

    Hi! It seems that the GFW was upgrading yesterday! It is really difficult to resolve websites abroad from dns server abroad by udp querying!

    So I try to use pdnsq+dnsmasq to resolve the websites abroad by tcp querying! So I use dnsmasq-china-list to help me resolving from China!

    I set the /etc/dnsmasq.conf and move this project file to /etc/dnsmasq.d "conf-dir=/etc/dnsmasq.d" & "server=127.0.0.1#1053"(which is pdnsq server)

    but It cannot resolve the websites from home and abroad!

    but using "no-resolve" and "server=127.0.0.1#1053" it does well, but it may be a little slower for Chinese websites resolving.

    How to fix it?

    opened by hduffddybz 6
  • Add acer.com

    Add acer.com

    国外

    ;; ANSWER SECTION: global-download.acer.com. 14400 IN CNAME global-download-akamai.gtm.acer.com. global-download-akamai.gtm.acer.com. 30 IN CNAME global-download.acer.com.edgesuite.net. global-download.acer.com.edgesuite.net. 14400 IN CNAME a1831.g.akamai.net. a1831.g.akamai.net. 20 IN A 210.0.146.147 a1831.g.akamai.net. 20 IN A 210.0.146.161

    国内 ;; ANSWER SECTION: global-download.acer.com. 77940 IN CNAME global-download-akamai.gtm.acer.com. global-download-akamai.gtm.acer.com. 30 IN CNAME global-download.acer.com.cdnudns.com. global-download.acer.com.cdnudns.com. 300 IN A 124.130.147.180

    然后 www 也是用的 akamai,索性 acer.com 都收录

    ;; ANSWER SECTION: www.acer.com. 79 IN CNAME public-akamai.gtm.acer.com. public-akamai.gtm.acer.com. 30 IN CNAME www.acer.com.edgesuite.net. www.acer.com.edgesuite.net. 12697 IN CNAME a492.b.akamai.net. a492.b.akamai.net. 20 IN A 210.0.146.154 a492.b.akamai.net. 20 IN A 210.0.146.162

    ;; ANSWER SECTION: www.acer.com. 30 IN CNAME public-akamai.gtm.acer.com. public-akamai.gtm.acer.com. 30 IN CNAME www.acer.com.edgesuite.net. www.acer.com.edgesuite.net. 16581 IN CNAME a492.b.akamai.net. a492.b.akamai.net. 30 IN A 184.50.87.91 a492.b.akamai.net. 30 IN A 184.50.87.122

    opened by soffchen 6
  • 允许使用者缩减列表

    允许使用者缩减列表

    通过与 Alexa Top-1M (全球网站访问量前100万)列表做交叉对比来缩减 accelerated-domains.china.conf 列表。

    手动安装模式下, make LITE=200000 即原列表与 Alexa 前 20 万名做对比,保留包含在前 20 万名中的站点/域名,其他的舍弃。

    opened by rampageX 5
  • Revome Domain Request for blueskyxn.com and 000714.xyz

    Revome Domain Request for blueskyxn.com and 000714.xyz

    Hello, I am the owner of blueskyxn.com and 000714.xyz. Due to the recent firewall of mainland China interfering with my transit node (forwarding overseas data sources to the CDN in mainland China through mainland optimized lines), some accesses are unstable. Coupled with the recent increase in the cost of traffic in mainland China, I hope to remove all my domains from the mainland China optimization list.

    The list of domain names is as follows (including all subdomains) blueskyxn.com 000714.xyz

    In your project, their locations are https://github.com/felixonmars/dnsmasq-china-list/commit/2cde3e0da86c3a75336b337494cf4ba871b15a56 https://github.com/felixonmars/dnsmasq-china-list/commit/4d3e9e58f6df03c03a40dd685db2cfab57507d6e

    In addition, if you know of other similar projects, I also hope to introduce them so that I can deal with them further.

    opened by BlueSkyXN 1
  • Migrate *.dji.com to dji.com

    Migrate *.dji.com to dji.com

    All of subdomains from dji.com seems have China mainland's CDN now like app-h5.dji.com is not incl., but it's provided China mainland's CDN service.

    I suggest consolidate all of dji.com's subdomains into /dji.com and add djicdn.com for fix

    opened by exiaohao 3
  • make clean 在Ubuntu系统中不能正确删除文件

    make clean 在Ubuntu系统中不能正确删除文件

    查了一下原因,应该是用了{},这是bash之类shell才有的特性。Makefile默认的shell是/bin/sh,然而ubuntu中/bin/sh默认指向了dash。在Makefile最前面加入 SHELL := /bin/bash 之后,make clean 正确删除了列出的文件。

    参考: https://askubuntu.com/questions/1395676/using-braces-in-rm-in-makefiles https://www.gnu.org/software/make/manual/html_node/Choosing-the-Shell.html#Choosing-the-Shell

    opened by windrosecn 0
Owner
Felix Yan
Old-school Arch Linux Developer, Lame Python Programmer, a stupid cat. PGP Key: 0x786C63F330D7CB92
Felix Yan
Configuration Management for Python ⚙

dynaconf - Configuration Management for Python. Features Inspired by the 12-factor application guide Settings management (default values, validation,

Bruno Rocha 2.8k Jan 6, 2023
Flexible Python configuration system. The last one you will ever need.

OmegaConf Description Project Code quality Docs and support OmegaConf is a hierarchical configuration system, with support for merging configurations

Omry Yadan 1.4k Jan 2, 2023
Pydantic-ish YAML configuration management.

Pydantic-ish YAML configuration management.

Dribia Data Research 18 Oct 27, 2022
Python Marlin Configurator to make valid configuration files to be used to compile Marlin with.

marlin-configurator Concept originally imagined by The-EG using PowerShell Build Script for Marlin Configurations The purpose of this project is to pa

DevPeeps 2 Oct 9, 2021
Configuration Extractor for EXE4J PE files

EXE4J Configuration Extractor This script helps reverse engineering Portable Executable files created with EXE4J by extracting their configuration dat

Karsten Hahn 6 Jun 29, 2022
Tools to assist with the configuration and maintenance of fapolicyd.

Tools to assist with the configuration and maintenance of fapolicyd.

Concurrent Technologies Corporation (CTC) 7 Dec 27, 2022
A tool to manage configuration files, build scripts etc. across multiple projects.

A tool to manage configuration files, build scripts etc. across multiple projects.

null 8 Dec 14, 2022
Simple dataclasses configuration management for Python with hocon/json/yaml/properties/env-vars/dict support.

Simple dataclasses configuration management for Python with hocon/json/yaml/properties/env-vars/dict support, based on awesome and lightweight pyhocon parsing library.

Teo Stocco 62 Dec 23, 2022
filetailor is a peer-based configuration management utility for plain-text files such as dotfiles.

filetailor filetailor is a peer-based configuration management utility for plain-text files (and directories) such as dotfiles. Files are backed up to

null 5 Dec 23, 2022
An application pulls configuration information from JSON files generated

AP Provisioning Automation An application pulls configuration information from JSON files generated by Ekahau and then uses Netmiko to configure the l

Cisco GVE DevNet Team 1 Dec 17, 2021
A Python library to parse PARI/GP configuration and header files

pari-utils A Python library to parse PARI/GP configuration and header files. This is mainly used in the code generation of https://github.com/sagemath

Sage Mathematical Software System 3 Sep 18, 2022
KConfig Browser is a graphical application which allows you to modify KDE configuration files found in ~/.config

kconfig_browser KConfig Browser is a graphical application which allows you to modify KDE configuration files found in ~/.config Screenshot Why I crea

null 11 Sep 15, 2022
Secsie is a configuration language made for speed, beauty, and ease of use.

secsie-conf pip3 install secsie-conf Secsie is a configuration language parser for Python, made for speed and beauty. Instead of writing config files

Noah Broyles 3 Feb 19, 2022
A slightly opinionated template for iPython configuration for interactive development

A slightly opinionated template for iPython configuration for interactive development. Auto-reload and no imports for packages and modules in the project.

Seva Zhidkov 24 Feb 16, 2022
🤫 Easily manage configs and secrets in your Python projects (with CLI support)

Installation pip install confidential How does it work? Confidential manages secrets for your project, using AWS Secrets Manager. First, store a secr

Candid™️ 63 Oct 30, 2022
Django-environ allows you to utilize 12factor inspired environment variables to configure your Django application.

Django-environ django-environ allows you to use Twelve-factor methodology to configure your Django application with environment variables. import envi

Daniele Faraglia 2.7k Jan 3, 2023
Inject your config variables into methods, so they are as close to usage as possible

Inject your config variables into methods, so they are as close to usage as possible

GDWR 7 Dec 14, 2022
Your own movie streaming service. Easy to install, easy to use. Download, manage and watch your favorite movies conveniently from your browser or phone. Install it on your server, access it anywhere and enjoy.

Vigilio Your own movie streaming service. Easy to install, easy to use. Download, manage and watch your favorite movies conveniently from your browser

Tugcan Olgun 141 Jan 6, 2023
Ptorch NLU, a Chinese text classification and sequence annotation toolkit, supports multi class and multi label classification tasks of Chinese long text and short text, and supports sequence annotation tasks such as Chinese named entity recognition, part of speech tagging and word segmentation.

Pytorch-NLU,一个中文文本分类、序列标注工具包,支持中文长文本、短文本的多类、多标签分类任务,支持中文命名实体识别、词性标注、分词等序列标注任务。 Ptorch NLU, a Chinese text classification and sequence annotation toolkit, supports multi class and multi label classification tasks of Chinese long text and short text, and supports sequence annotation tasks such as Chinese named entity recognition, part of speech tagging and word segmentation.

null 186 Dec 24, 2022
EchoDNS - Analyze your DNS traffic super easy, shows all requested DNS traffic

EchoDNS - Analyze your DNS traffic super easy, shows all requested DNS traffic

Oli Zimmermann 1 Jan 11, 2022