All Projects → AhaDNS → dns-server-setup

AhaDNS / dns-server-setup

Licence: GPL-3.0 license
Ansible playbook to easily deploy new, fully configured, DNS servers.

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to dns-server-setup

Smartdns
A local DNS server to obtain the fastest website IP for the best Internet experience, 一个本地DNS服务器,获取最快的网站IP,获得最佳上网体验。
Stars: ✭ 4,333 (+8927.08%)
Mutual labels:  dns-server, dns-over-https, dns-over-tls
aiodns
A All-In-One DNS Solution written in Go
Stars: ✭ 23 (-52.08%)
Mutual labels:  dns-over-https, dns-over-tls
harddns
RFC8484 and DoH/JSON resolver
Stars: ✭ 35 (-27.08%)
Mutual labels:  dns-server, dns-over-https
Dnspython
a powerful DNS toolkit for python
Stars: ✭ 1,838 (+3729.17%)
Mutual labels:  dns-over-https, dns-over-tls
powerdns
PowerDNS dnsdist, recursor, authoritative, and admin interface. Supports DNSCrypt, DoH, and DoT.
Stars: ✭ 35 (-27.08%)
Mutual labels:  dns-over-https, dns-over-tls
q
A tiny command line DNS client with support for UDP, TCP, DoT, DoH, DoQ and ODoH.
Stars: ✭ 453 (+843.75%)
Mutual labels:  dns-over-https, dns-over-tls
dns-resolver-infra
Privacy DNS infrastructure
Stars: ✭ 39 (-18.75%)
Mutual labels:  dns-over-https, dns-over-tls
mosdns-cn
A simple DNS forwarder that can make life easier.
Stars: ✭ 254 (+429.17%)
Mutual labels:  dns-over-https, dns-over-tls
DNS-over-HTTPS
An implementation of RFC 8484 - DNS Queries over HTTPS (DoH).
Stars: ✭ 27 (-43.75%)
Mutual labels:  dns-server, dns-over-https
AdGuardHome
Network-wide ads & trackers blocking DNS server
Stars: ✭ 16,027 (+33289.58%)
Mutual labels:  dns-over-https, dns-over-tls
gochinadns
Project archived: I believe Clash has provides a more elegant DNS & proxy solution. So there is no need to maintain this project. Have fun guys! ----- A drop-in replacement for ChinaDNS, with a better code implementation and several bugfixes.
Stars: ✭ 38 (-20.83%)
Mutual labels:  dns-server, dns-over-https
dnsredir
Yet another seems better forward/proxy plugin for CoreDNS
Stars: ✭ 58 (+20.83%)
Mutual labels:  dns-over-https, dns-over-tls
bebasdns
Membantumu berselancar dengan aman dan tidak terbatas!.
Stars: ✭ 56 (+16.67%)
Mutual labels:  dns-over-https, dns-over-tls
AdGuard-WireGuard-Unbound-Cloudflare
The Ultimate Network Security Guide 🔒 Protection | 🔎 Privacy | 🚀 Performance on home network 24/7 🕛 Accessible anywhere 🌏
Stars: ✭ 160 (+233.33%)
Mutual labels:  dns-over-https, dns-over-tls
jp.tiar.app
jp.tiar.app
Stars: ✭ 28 (-41.67%)
Mutual labels:  dns-over-https, dns-over-tls
dns.sb
https://dns.sb/
Stars: ✭ 32 (-33.33%)
Mutual labels:  dns-over-https, dns-over-tls
prc-dns
对CDN友好的DNS服务器,区分国内外流量的必备工具。
Stars: ✭ 47 (-2.08%)
Mutual labels:  dns-server, dns-over-https
Secure-Adblocking-DNS
Secure (DNS-over-TLS) Adblocking (Pi-hole) Recursive (unbound) Server System setup
Stars: ✭ 19 (-60.42%)
Mutual labels:  dns-server, dns-over-tls
dcompass
A high-performance programmable DNS component aiming at robustness, speed, and flexibility
Stars: ✭ 260 (+441.67%)
Mutual labels:  dns-server, dns-over-https
chatroom
💬chat
Stars: ✭ 56 (+16.67%)
Mutual labels:  ansible-playbook

dns-server-setup

Ansible playbook to easily deploy new DNS servers. This playbook is used to deploy all AhaDNS DNS server nodes. This playbook also gives you the option to deploy a server that only answers to DNS queries over encrypted channels such as DNS-over-HTTPS and DNS-over-TLS.

Intended usecase

This ansible playbook deploys a fully configured AhaDNS server instance (except securing SSH config) featuring:

  • Blocking DNS server using oisd block list.
    • Block list automatically updated every 4 hours.
  • Unbound as recursive DNS server.
  • DNS over HTTPS (DoH) using NGINX and m13253's DoH server.
  • DNS over TLS (DoT) using NGINX.
  • Automatic SSL certificates for DoH & DoT by Let's Encrypt.
  • Locked-down firewall using IPTables.
  • Optimized sysctl config.
  • Automatic security updates enabled.
  • DNS request statistics API from AhaDNS/Aha.Dns.Statistics
    • GET endpoint will be available at https://{{ hostname }}/UnboundControlStats?api_key={{ ahaDnsStatisticsApiKey }}

All configuration that will be applied can be found in the files directory. The playbook is primarily created for AhaDNS but the public is of course welcome to use it as well.

Encrypted DNS only?

By editing the variable only_encrypted_dns in the hosts file you can select to deploy a fully configured DNS server that only allows encrypted DNS queries over DNS-over-TLS and DNS-over-HTTPS. Regular unencrypted queries over port 53 will be blocked. It's recommended to set this variable to true whenever possible.

Disclaimer

Please, do not set up public DNS servers if you don't know what you're doing. This Ansible playbook have been created during late evenings and I do not take any responsibility of the outcome of the playbook execution. Feel free to improve the notebook and submit your changes in a PR.

Prerequisites

  1. You must own a Fully Qualified Domain Name (FQDN) for:
    • Server hostname i.e. hostname.my.domain
    • DoH endpoint i.e. doh.hostname.my.domain
    • DoT endpoint i.e. dot.hostname.my.domain
  2. You must setup an A (and AAAA if IPv6 is desired) DNS zone for the three FQDN's mentioned above, pointing to the IP of the Linux server. Otherwise Let's Encrypt certificate creation will fail.

Install instructions

  1. Secure your SSH config to your preference on the host before running the playbook.
  2. Install Ansible on the machine that will run the playbook.
  3. Clone this repository using git clone https://github.com/AhaDNS/dns-server-setup.git
  4. Edit the hosts file to reflect your setup, i.e. change vars. playbook.yml does NOT need to be changed.
  5. Start playbook using ansible-playbook playbook.yml -i hosts --ask-become-pass -T 60
  • It is safe to re-execute the playbook multiple times.

Supported distros

  • Ubuntu 20.04 LTS
  • Debian 10 (untested)

Usage instructions

This is a high performance setup and does not provide any graphical user interface for configuration. After installation, you might want to:

  • Learn how the block/white-list are created and updated (see /etc/ahadns/unbound_update.sh)
  • Check your DNS request statistics by doing a GET query curl https://{{ hostname }}/UnboundControlStats?api_key={{ ahaDnsStatisticsApiKey }}
    • Change {{ hostname }} and {{ ahaDnsStatisticsApiKey }} with values used in the hosts file during setup
  • Tune the unbound config to your system (edit /etc/unbound/unbound.conf.d/ahadns.conf)
    • Should not be needed as it's automatically tuned during playbook execution

Support

We do not provide any official support for this playbook, but you can always reach out to us at:

And we'll try to hep you in best-effort.

Uninstall instructions

We do not provide any uninstall instructions yet. For now, we recommend you to reinstall your OS to completely remove everything.

Known issues

  • Playbook stuck on iptables restore v4 or iptables restore v6
    • Solution:
      • Stop the playbook execution (with ctrl + c), Then re-run the playbook.
  • Got error message Using a SSH password instead of a key is not possible because Host Key checking is enabled and sshpass does not support this. Please add this host's fingerprint to your known_hosts file to manage this host.
    • Solution:
      • On the machine running ansible, run export ANSIBLE_HOST_KEY_CHECKING=False

Acknowledgements

License

Unless otherwise specified, all code in this repository is released under the GNU General Public License v3.0. See the repository's LICENSE file for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].