Convert Figma logo to code with AI

felixonmars logodnsmasq-china-list

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

5,489
829
5,489
22

Top Related Projects

26,451

🔒 Consolidating and extending hosts files from several well-curated sources. Optionally pick extensions for porn, social media, and other categories.

1,672

AD hosts爱好群,群号:201973909;无限期暂停更新。劝君更尽一杯酒,西出阳关无故人。莫愁前路无知己,天下谁人不识君。

自由·负责·克制 去广告 Hosts 项目

Network-wide ads & trackers blocking DNS server

Quick Overview

The felixonmars/dnsmasq-china-list repository is a collection of domain lists for dnsmasq, specifically tailored for Chinese internet users. It aims to improve DNS resolution speed and reliability for Chinese websites by providing pre-configured lists of domains that can be resolved using Chinese DNS servers.

Pros

  • Improves DNS resolution speed for Chinese websites
  • Reduces reliance on potentially blocked or slow foreign DNS servers
  • Regularly updated to maintain accuracy and effectiveness
  • Easy to integrate with existing dnsmasq configurations

Cons

  • Primarily focused on Chinese domains, limiting its usefulness for non-Chinese users
  • Requires manual updates or additional scripts to keep the lists current
  • May not cover all Chinese domains, potentially leading to some slower resolutions
  • Could potentially include domains that users might prefer to resolve through foreign DNS servers

Getting Started

To use the dnsmasq-china-list:

  1. Clone the repository:

    git clone https://github.com/felixonmars/dnsmasq-china-list.git
    
  2. Copy the desired list files to your dnsmasq configuration directory (e.g., /etc/dnsmasq.d/):

    sudo cp dnsmasq-china-list/accelerated-domains.china.conf /etc/dnsmasq.d/
    sudo cp dnsmasq-china-list/bogus-nxdomain.china.conf /etc/dnsmasq.d/
    
  3. Restart dnsmasq:

    sudo systemctl restart dnsmasq
    
  4. (Optional) Set up a cron job to periodically update the lists:

    0 2 * * * cd /path/to/dnsmasq-china-list && git pull && sudo systemctl restart dnsmasq
    

Competitor Comparisons

26,451

🔒 Consolidating and extending hosts files from several well-curated sources. Optionally pick extensions for porn, social media, and other categories.

Pros of hosts

  • More comprehensive blocking list, covering various categories like malware, adware, and phishing domains
  • Regular updates and community-driven contributions
  • Flexible configuration options for different use cases

Cons of hosts

  • May block legitimate domains in some cases, requiring manual whitelisting
  • Larger file size due to extensive list, potentially impacting performance on low-end devices
  • Not specifically optimized for Chinese internet users

Code Comparison

hosts:

0.0.0.0 example.com
0.0.0.0 malware.example.net
0.0.0.0 ads.example.org

dnsmasq-china-list:

server=/example.com/114.114.114.114
server=/baidu.com/114.114.114.114
ipset=/google.com/gfwlist

The hosts project uses a simple hosts file format, blocking domains by redirecting them to 0.0.0.0. The dnsmasq-china-list project uses dnsmasq configuration syntax, specifying DNS servers for Chinese domains and creating IP sets for domains that require VPN access.

Both projects aim to improve internet browsing experience, but with different focuses. hosts provides a general-purpose blocking solution, while dnsmasq-china-list is tailored for optimizing internet access in China.

1,672

AD hosts爱好群,群号:201973909;无限期暂停更新。劝君更尽一杯酒,西出阳关无故人。莫愁前路无知己,天下谁人不识君。

Pros of yhosts

  • Broader scope: Includes ad-blocking and privacy protection beyond just DNS
  • More frequent updates: Generally updated more often than dnsmasq-china-list
  • Supports multiple platforms and applications

Cons of yhosts

  • Larger file size: May impact performance on low-end devices
  • Potential for false positives: More aggressive blocking can sometimes affect legitimate content
  • Less focused: Not specifically optimized for DNS-based filtering

Code Comparison

dnsmasq-china-list:

server=/cn/114.114.114.114
server=/xn--fiqs8s/114.114.114.114
server=/xn--fiqz9s/114.114.114.114
server=/0-6.com/114.114.114.114
server=/0001688.com/114.114.114.114

yhosts:

0.0.0.0 ad.12306.cn
0.0.0.0 ad.3.cn
0.0.0.0 ad.95306.cn
0.0.0.0 ad.csdnimg.cn
0.0.0.0 ad.flipboard.com

The code snippets show that dnsmasq-china-list focuses on DNS server assignments for Chinese domains, while yhosts uses a more traditional hosts file format to block specific ad domains. This reflects their different approaches to content filtering and network optimization.

自由·负责·克制 去广告 Hosts 项目

Pros of neohosts

  • More comprehensive blocking list, including ads, tracking, and malware domains
  • Regular updates and active community contributions
  • Supports multiple formats (hosts, dnsmasq, etc.) for wider compatibility

Cons of neohosts

  • May cause over-blocking, potentially affecting some legitimate services
  • Larger file size due to more extensive list, which could impact performance
  • Requires more frequent updates to maintain effectiveness

Code Comparison

dnsmasq-china-list:

server=/cn/114.114.114.114
server=/xn--fiqs8s/114.114.114.114
server=/xn--fiqz9s/114.114.114.114
server=/xn--55qx5d/114.114.114.114
server=/xn--io0a7i/114.114.114.114

neohosts:

0.0.0.0 ad.example.com
0.0.0.0 tracker.example.com
0.0.0.0 malware.example.com
::1 ad.example.com
::1 tracker.example.com

The dnsmasq-china-list focuses on DNS server assignments for Chinese domains, while neohosts provides a more general-purpose blocking list for various unwanted domains. neohosts includes both IPv4 and IPv6 entries, offering broader coverage for different network configurations.

Network-wide ads & trackers blocking DNS server

Pros of AdGuardHome

  • Comprehensive DNS server with built-in ad blocking and filtering capabilities
  • User-friendly web interface for easy configuration and management
  • Supports multiple platforms and can be run as a standalone application

Cons of AdGuardHome

  • More resource-intensive due to its extensive features
  • Requires more setup and configuration compared to simpler DNS lists
  • May have a steeper learning curve for users new to DNS management

Code Comparison

dnsmasq-china-list:

server=/cn/114.114.114.114
server=/alibaba.com/223.5.5.5
server=/baidu.com/180.76.76.76

AdGuardHome:

dns:
  upstream_dns:
    - 1.1.1.1
    - 8.8.8.8
  filters:
    - enabled: true
      url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt

The dnsmasq-china-list provides a simple list of domain-to-DNS server mappings, while AdGuardHome offers a more complex configuration with upstream DNS servers and filtering options.

AdGuardHome is a full-featured DNS server with ad blocking capabilities, offering a comprehensive solution for network-wide content filtering and DNS management. In contrast, dnsmasq-china-list is a lightweight list of DNS servers for Chinese domains, primarily used to improve DNS resolution for Chinese websites.

While AdGuardHome provides more functionality and flexibility, dnsmasq-china-list is simpler to implement and requires fewer resources. The choice between the two depends on the specific needs of the user, such as the desired level of control, available resources, and the complexity of the required DNS setup.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

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 <felixonmars@archlinux.org>
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.