|
| 1 | +# 🏠 Home Assistant Add-on: Technitium DNS Server |
| 2 | + |
| 3 | +## 📝 TL;DR |
| 4 | + |
| 5 | +Quick setup and best practices: |
| 6 | + |
| 7 | +### DNS Server Setup |
| 8 | + |
| 9 | +- Use this add-on as your primary DNS server |
| 10 | +- Configure your router DNS to use `homeassistant.local` (or Home Assistant IP) |
| 11 | + |
| 12 | +### Local DNS Zone |
| 13 | + |
| 14 | +```plaintext |
| 15 | +# Quick zone setup |
| 16 | +1. Access via the Web UI |
| 17 | +2. Add zone: home.lab |
| 18 | +3. Add records: |
| 19 | + nas.home.lab. A 192.168.1.10 |
| 20 | + printer.home.lab A 192.168.1.20 |
| 21 | +``` |
| 22 | + |
| 23 | +## DNS Flow and Protocol Options |
| 24 | + |
| 25 | +> This diagram illustrates how DNS queries flow through your network, showing both unencrypted (🔓) and encrypted (🔐) paths. Local devices can use either standard DNS or secure protocols (DoH/DoT/DoQ) to query the Technitium DNS Server, which then forwards requests to Cloudflare using selected dns_forwarders. |
| 26 | +
|
| 27 | +![DNS flow diagram][dns-diagram] |
| 28 | + |
| 29 | +### Key Points |
| 30 | + |
| 31 | +- 🏡 **Local Network**: Devices and router can use any supported protocol |
| 32 | +- 🔒 **Security Options**: Choose between standard DNS or encrypted protocols |
| 33 | +- 🌐 **Flexible Forwarding**: All protocols supported for external queries |
| 34 | +- ⚡ **Modern Standards**: Full support for DoH, DoT, and DoQ |
| 35 | + |
| 36 | +> [!NOTE] |
| 37 | +> Port 53 (DNS) is always available for compatibility with standard clients. |
| 38 | +
|
| 39 | +## 🔧 Configuration |
| 40 | + |
| 41 | +> [!NOTE] |
| 42 | +> When accessing the web interface for the first time: |
| 43 | +> |
| 44 | +> - **Username:** `admin` |
| 45 | +> - **Password:** `admin` |
| 46 | +> |
| 47 | +> You will be required to change the password on your first login for security purposes. |
| 48 | +
|
| 49 | +### 🎯 Best Practices |
| 50 | + |
| 51 | +This add-on is designed to be your primary DNS server, acting as a secure forwarding DNS server that queries external DNS providers using encrypted protocols (DoH or DoT). |
| 52 | + |
| 53 | +Recommended setup: |
| 54 | + |
| 55 | +1. Configure your router to use this DNS server (typically `homeassistant.local` or the IP of your Home Assistant) |
| 56 | +2. Or configure individual devices to use this DNS server |
| 57 | +3. Use encrypted forwarding (DoH, DoT, or DoQ) to upstream DNS providers |
| 58 | +4. Keep query logging enabled for troubleshooting |
| 59 | +5. Optionally, set up local DNS zones for your home lab (e.g., `home.lab`, `internal`) |
| 60 | + |
| 61 | +> [!TIP] |
| 62 | +> By using this add-on as your DNS server, you get: |
| 63 | +> |
| 64 | +> - Encrypted DNS queries to external providers |
| 65 | +> - Local DNS resolution for your network |
| 66 | +> - Query logging for troubleshooting |
| 67 | +> - Ability to block unwanted domains |
| 68 | +> - Faster response times through caching |
| 69 | +> - Custom domain names for local devices |
| 70 | +> - Service discovery through DNS records |
| 71 | +
|
| 72 | +### 🔌 Port Configuration |
| 73 | + |
| 74 | +| Port | Protocol | Description | |
| 75 | +| ---- | -------- | ---------------------------------- | |
| 76 | +| 53 | UDP | Standard DNS service | |
| 77 | +| 853 | TCP | DNS-over-TLS | |
| 78 | +| 853 | UDP | DNS-over-QUIC | |
| 79 | +| 443 | TCP | DNS-over-HTTPS (HTTP/1.1 + HTTP/2) | |
| 80 | +| 443 | UDP | DNS-over-HTTPS (HTTP/3) | |
| 81 | + |
| 82 | +To change port mappings: |
| 83 | + |
| 84 | +1. Go to the add-on configuration page |
| 85 | +2. Scroll to "Network" section |
| 86 | +3. Click the port number you want to change |
| 87 | +4. Enter new port number (e.g., `8853` for DNS-over-TLS) |
| 88 | +5. Click "Save" |
| 89 | + |
| 90 | +> [!NOTE] |
| 91 | +> Only port 53 are enabled by default. |
| 92 | +
|
| 93 | +### 🏠 Local DNS Zones |
| 94 | + |
| 95 | +Technitium DNS Server can host your own DNS zones for your home lab environment. |
| 96 | + |
| 97 | +#### Setting up a Local Zone |
| 98 | + |
| 99 | +1. Access the web interface at `http://homeassistant.local:5380` |
| 100 | +2. Navigate to Zones → Add Zone |
| 101 | +3. Enter your desired domain (e.g., `home.lab`, `local.network`) |
| 102 | +4. Click "Add" |
| 103 | + |
| 104 | +Example records for your home lab: |
| 105 | + |
| 106 | +```plaintext |
| 107 | +# A Records (IPv4) |
| 108 | +server1.home.lab. A 192.168.1.10 |
| 109 | +nas.home.lab. A 192.168.1.20 |
| 110 | +printer.home.lab. A 192.168.1.30 |
| 111 | +
|
| 112 | +# CNAME Records (Aliases) |
| 113 | +www.home.lab. CNAME server1.home.lab. |
| 114 | +files.home.lab. CNAME nas.home.lab. |
| 115 | +
|
| 116 | +# TXT Records (Service Information) |
| 117 | +home.lab. TXT "v=spf1 ip4:192.168.1.0/24 -all" |
| 118 | +_service.home.lab. TXT "location=basement rack=1" |
| 119 | +``` |
| 120 | + |
| 121 | +### 🏗️ Advanced Configuration |
| 122 | + |
| 123 | +#### Reverse DNS Zone |
| 124 | + |
| 125 | +```plaintext |
| 126 | +# Create reverse zone for 192.168.1.0/24 |
| 127 | +Zone name: 1.168.192.in-addr.arpa |
| 128 | +
|
| 129 | +# PTR Records |
| 130 | +10 PTR server1.home.lab. |
| 131 | +20 PTR nas.home.lab. |
| 132 | +30 PTR printer.home.lab. |
| 133 | +``` |
| 134 | + |
| 135 | +> [!TIP] |
| 136 | +> Best practices for local zones: |
| 137 | +> |
| 138 | +> - Use a dedicated domain suffix (e.g., `.home.lab`, `.internal`) |
| 139 | +> - Document all DNS records |
| 140 | +> - Use meaningful naming conventions |
| 141 | +> - Set appropriate TTL values |
| 142 | +> - Regular backups of zone files |
| 143 | +
|
| 144 | +## 🔍 Troubleshooting |
| 145 | + |
| 146 | +### ❌ Common Issues |
| 147 | + |
| 148 | +1. **Certificate Issues** |
| 149 | + - Check certificate paths are correct |
| 150 | + - Verify certificate permissions |
| 151 | + - Check logs for certificate conversion errors |
| 152 | + |
| 153 | +2. **Port Conflicts** |
| 154 | + - Ensure no other services use ports |
| 155 | + - Try alternative ports if needed |
| 156 | + - Check firewall settings |
| 157 | + |
| 158 | +3. **DNS Resolution Problems** |
| 159 | + - Verify forwarder settings |
| 160 | + - Check DNS server logs |
| 161 | + - Test with `dig` or `nslookup` |
| 162 | + |
| 163 | +## 💡 Support |
| 164 | + |
| 165 | +Got questions? |
| 166 | + |
| 167 | +- Create an [issue on GitHub][issue] for bug reports, feature requests, or questions |
| 168 | +- Add a ⭐️ [star on GitHub][repository] to support the project |
| 169 | + |
| 170 | +## 🤝 Contributing |
| 171 | + |
| 172 | +This is an active open-source project. We welcome contributions from anyone interested in using or improving the code: |
| 173 | + |
| 174 | +- Fork the repository |
| 175 | +- Make your changes |
| 176 | +- Submit a pull request |
| 177 | +- Follow the coding standards |
| 178 | + |
| 179 | +## 👥 Authors & Contributors |
| 180 | + |
| 181 | +The original setup of this repository is by [Jeppe Stærk][staerk]. |
| 182 | + |
| 183 | +## 🙏 Acknowledgments |
| 184 | + |
| 185 | +Special thanks to [Franck Nijhof][frenck] and the [Home Assistant Community Add-ons][ha-addons] project for their invaluable work. This add-on heavily relies on their foundation: |
| 186 | + |
| 187 | +- Base container images |
| 188 | +- CI, workflows and best practices |
| 189 | +- Readme and docs templates |
| 190 | + |
| 191 | +Their open-source contributions make add-ons like this possible. |
| 192 | + |
| 193 | +## ⚠️ Disclaimer |
| 194 | + |
| 195 | +This is a third-party add-on for Home Assistant and not an official add-on. It is provided as-is, without warranty of any kind. While care has been taken in its development, use it at your own risk. Always ensure you have proper backups before making changes to your Home Assistant DNS settings. This add-on is not affiliated with Technitium Software. |
| 196 | + |
| 197 | +## 📄 License |
| 198 | + |
| 199 | +MIT License - Copyright (c) 2025 Jeppe Stærk |
| 200 | + |
| 201 | +[dns-diagram]: https://raw.githubusercontent.com/staerk-ha-addons/addon-technitium-dns/refs/heads/main/images/flowchart-dns.svg |
| 202 | +[frenck]: https://github.com/frenck |
| 203 | +[issue]: https://github.com/staerk-ha-addons/addon-technitium-dns/issues |
| 204 | +[repository]: https://github.com/staerk-ha-addons/repository |
| 205 | +[staerk]: https://github.com/staerk-ha-addons |
| 206 | +[ha-addons]: https://addons.community/ |
| 207 | +[duckdns-link]: https://github.com/home-assistant/addons/tree/master/duckdns |
| 208 | +[security-link]: https://www.home-assistant.io/docs/configuration/securing/#remote-access |
0 commit comments