You're an absolute legend. I've followed two of your videos now and both have been enormous time savers. I'm just getting started with a homelab and setting everything up is extremely daunting and time consuming. You're an incredible resource!
I did not know you could use Visual Studio Code to simulataneously access an SSH terminal and access remote folders. You just made my job easier to drop files to my servers. Thank you, Christian.
Your are far by the best RUclipsr for this kind of content as you don't just explain how to do something, you explain why to do things and how they actually work and not just saying put this here and there and it'll work. Love it!!! Shows you have put a lot of time into understanding the concepts properly.
Bit of advice, never use the :latest tag, look up the latest version tag (eg 2.4.2) and use that one instead. Always use a specific version and update in a controlled manner. You do not want to be in a situation where you've accidentally pulled a new version and your config files no longer work with that version. It will save you a lot of headache when something goes wrong or you have to migrate to a new server. You can backup your configs and docker file, but it does not ensure you that those config files will work on another device as you've not defined a version tag in your docker file, you may pull a completely different version. (I'm bad at explaining, please do look up why you shouldn't use :latest to understand it better)
There is a middle ground in between the `latest` tag or a tag pointing to a specific release. The current stable nginx release is version `1.23.3`, this version can currently be referenced by multiple tags like `latest`, `stable`, `1.23.3` or even `1`. If the images maintainers are competent, these additional tags will be updated on every release. To always use the latest nginx release of version 1.x.x, but never accidentially use the releases of another major release (2.x.x), just use the tag `1`. In a corporate environment, where all changes to the infrastructure have to be managed in a certain way, you hopefully want to control the update process and also the whole image registry and image build process anyways and push new releases to the registry yourself.
Hi Christian ! Nice Bind opening clip. But more interesting will be to make a public/local DNS server and segregating trafic will be a nice continuations. Also a good tutorial, as you do, about MX records with DKIM, DMARK , SPF records ;-)
I now use technitium dns server - it‘s open source, easy to install on every os (docker, too), very feature rich, really secure and completely with graphical user interface.
Fantastic! You explain it in a way that is so easy to understand. When I hade to learn Bind 30 years ago it took forever and was as theoretical as it could be. Thank you again for an excellent tutorial.
Hey you seem like a guy who can resolve my query | Hopefully ! I want to learn to serve a containered app to the internet. is that really possible? i believe if i configure dns settings locally good and also configure it with global dns like cloudflare it would really work will this really work [is that practical / feasible] will be waiting for your reply Thanks !
Nice video to kick-off 2023 and a great explanation how to set up a bind server. It's a long video, and I was only loosely interested, but finished it in one viewing. One of your best video's ever!
Wow, this is awesome. I was always frustrated with the number of changes needed to have proper DNS resolution in a small network without a proper DNS server. Had I only invested a few hours to understand and setup bind9, this would have saved me a ton of time. Thanks Christian.
I almost switched my DNS to BIND, but decided to go with Unbound and NSD instead. Still, great video, configuring services like DNS and DHCP for your own network by hand is really a great learning experience
This have been the most useful source I found for setting up an DNS Server, and granted I still had to troubleshoot somethings but this was so helpful and didn't over complicated things
Hallo Christian, von mir und meiner Familie wünsche ich ein frohes neues, glückliches und erfolgreiches Jahr 2023! Meine Kinder stehen total auf deine IT Beiträge, wir schauen dieses Video gerade zusammen auf dem Beamer. Gruß aus Wiesbaden und vielen Dank für die Mühe : )
Hi Christian, interesting video. Just an idea: you could install a second Bind9 server and use the VRRP Protocol to cover the fallout of the first one. I‘ve done that with 2 Piholes on different servers with 1 virtual DNS address. If the first DNS server fails, the second one automatically takes command of the name resolution until the first one recovers 🤷🏼♂️. Works flawlessly! LG aus Luxemburg 🇱🇺
Hi, thank you for this great video! I'm actually preparing to provide an own DNS server (also planned to use the Ubuntu/bind9 docker image) for my local network. You give many useful tips that will help. So again: thank you and you have a new follower now 😉. Cheers from Germany!
Don’t forget to add the docker networks to the internal ACL list, or you may end up like me wondering why portainer does not resolve 😅 BTW I use views to control who sees what. As a side note if you are privacy cautious do not use forwarders. Bind is capable to resolve on its own. You may need to setup a hint zone to speed things up a little.
One thing you may want to look at for outside requests using an SSL DNS server. I have the outside request routing through STunnel. This will stop anyone from logging your DNS requests
I use NextDNS as I can use it to protect my kids from nasties on the Web, both on my LAN and when they roam. It's an easy package to install on OpenWRT. I ended up doing split horizon without even knowing what it was by putting my internal services in the hosts file on OpenWRT. It works so I don't want to mess with it but would really like to move away from OpenWRT. This has given me a lot to think about. Thank you for the guide 👍
Danke, genau was ich gesucht hab. Da Bind9 nur die Config Files braucht kann man das auch Super als Infrastructure as Code direkt aus dem Git hochziehen lassen. Perfekt Terraform für die VM und dann Ansible & Docker um Bind9 zu deployen. So macht Infrastruktur Spaß :)
Hey Chris, have you tried integrating PowerDNS for graphical management of DNS? It would be interesting to see it in a video. I have it set up in my lab with KVM/LXC and it's very useful.
Several days ago I tried to find good solution DNS server + simple web UI (preferrable is not 3rd party). And found that there is only one solution for this, called SnitchDNS. And decided that the best option is PowerDNS + 3rd party PowerDNS-Admin. Might Chris do not need UI for DNS management, because its his homelab with one user.
@christianlempa a few notes: 7:26 Small nit-pick: it's "I. S. C." (Internet Systems Consortium) and not "I. C. S." You mentioned the incorrect acryonym a few times. 18:30 Try using dig (vs nslookup), since you're using BIND. IMHO (and as a former DNS admin for a large ISP), dig is more powerful and streamlined. For EL distros, you'll find it in the "bind-utils" package. Not sure about Mac or Debian-based distros like Ubuntu. 19:30 FYI, the reason why you can use .home, .corp, and .mail (but not .local) TLDs on your private network is because ICANN's board found they were already in prevalent use, and attempting to introduce them publicly would be "high-risk" due to potential name collisions. Originally, these TLDs were not listed in any standard (or RFC) and were technically off-limits (even though people still used them), at least until ICANN Resolution 2018.02.04.12 stated "the delegations of such high-risk strings would be deferred indefinitely." 21:15 Use named-checkconf and named-checkzone. There's probably a config option or extension in VScode to automate this, or you can just add a precommit githook. 31:30 I'm surprised you went with BIND over CoreDNS, since I know you're interested in Kubernetes and especially given your automation aspirations (check the ectd plugin for use outside of k8s).
Hey, just a tip. If you want to show console input/output, maybe move the window up a little, because if you watch the video with subtitles, you can't at all see what's going on.
Thanks Chistian! How about your SSL certs? Now i'm using NGINX Proxy manager with an subdomain wildcard to my home dns entry. Are you still facing something public? Or are you using wildcard certs with Letsencrypt with an dns challenge?
Damnn, this bring back memories. I have an class where we configured an linux machine from the ground up, and dns with bind9 was one of the configurations we have to do, sadly at the time I don't give much value to it and only remenbered now
I've been running bind for years now. I use a caching dns config to speed up things. I deploy my services via Ansible which also manages my zones via Ansible templates. Traefik is awesome in that chain to facilitate reverse proxying. Really great recap on all the intricacies!
Hi! I am running in a problem that it looks like you solved. I use a dockerized NGINX proxy manger. I setup bind9 but I cant make the 2 work together. what should I do?
I'm way behind but I'm also going back to bind9. We used it at work a couple of years ago and I laughed at the old half-dead guys running it.. now I'd love to have it that simple and being able to easily manage it automagically with Ansible or Terraform.
Thanks a lot, Christian and a blessed 2023. Do you planned a second part with explaining split horizon and things like TLS w/LE for our local labs (0:52)?
Thanks Christian, this is an excellent video. I may want to have a Bind9 server cache all the external DNS entries often used across my local network. Is there an automated way to have external entries refreshed after TTL has expired, or is this a bad idea?
Great video Christian! I'm looking at creating implementing my own DNS service in a private subnet in the cloud (rather than at home), which I connect to via a VPN, and I'm considering doing this. I'm sure there are probably some tools offered by the cloud provider (I'd rather not use those, in this particular cAWSe, or maybe by the VPN server (openvpn access server), but bind9 seems like a solid way to do things. I've yet to watch your Cloudfare Tunnel videos, so maybe those have some info re. DNS while connected remotely.. As always, I learned a ton; looking forward to the next video!
I'd put a caching server like pihole on the inside and give out that IP to clients. That creates a consistent model for internal and external/3rd party domains: client->cache->[main cache]->authoritative server. This scales better if you go multi-site as you keep your authoritative systems in the data centre and put dumb caches out on sites and you can put your authoritative server somewhere nice like a DMZ, where it can publish out to the internet and do zone transfers to your ISP if required. Of course you can zone transfer to the DC (for things like dhcp dns registrations), but I think its neater centralise first if possible. You probably want to protect your primary DNS server with a DMZ which only allows outbound zone transfers to secondaries and doesn't answer queries itself. If someone hacks your DNS, you're toast.
Thanks.. always as interesting, this is how I drive with bind9 I've been running Bind for a few years now and am completely satisfied. I send the questions to the Nginx reverse proxy which puts on the ssl certificate before servers.
Hi Christian, really like you video and passion about technology. Just wonder do you have a tutorial on a quick ways to spin up new Ubuntu server 22.04.1 LTS from cloned image with sysprep so all the UUID/MAC address will be unique for each machine?
@Christian, you’re an amazing teacher. You take some pretty complex subjects and make them not only understandable but exciting to try (at least for nerds like me). One question. You are using two different programs. One for terminal commands and one for text files. Both have some sort of auto-complete working on them. Can you share what two programs those are? I’m just curious. Thanks for another great video.
They are WARP termial and VS Code editor. Btw, if you not use macOS, and bash, zsh, or fish is your default shell, you could try oh-my-bash, oh-my-zsh, or oh-my-fish to enhance your default shell. The basic auto-complete script is included in enhancements, and you can also add your customize auto-complete scripts to the configuration file.
While bind9 will certainly do the job more than well, another lighter alternative is unbound (by NLnet Labs), which is also very flexible. Most people can actually do with a DNS resolver instead of a full DNS server. 👍
Hey Christian! Nice video! I can see this fitting perfectly into my own lab :-). Just wondering if you'd consider a 2nd container (or K3S) orso as a secondary (Internal) DNS (to maintain HA). I'm not sure if you can configure that as well in your Sophos? (perhaps round robin). Maybe this is an overkill, but you keep mentioning that this is something you'd want to scale up to 'enterprise' levels. ;-).
Hi Christian, I have one mir question: in the compilation of DHCP with Sophos XG and bind9, is it possible to get not reserved ip addresses from dhcp, this ip, hostname and domain is registered und bind9, so that this ip and this hostname can be resolved? I try to not reserve ip addresses and I do not want to create manuell bind enties. For me this works right now only with dhcp and unbound and only when both services run on the opnsense.
I am having good results since switching to Unbound. Be careful. When using a public resolver like Quad9 or Cloudflared, your ISP can still transparently proxy your DNS requests. This is referred to as a DNS leak. With Unbound, or Bind9, the DNS server on your network contacts different DNS root servers online and prevents DNS leaks. For some reason, I could not successfully use DoH or DoT (within AdGuard Home) without my requests being intercepted by my ISP's DNS proxies, as proven by the online DNS Leaktest websites. I would love to migrate from Unbound to Bind9 as BIND acts as an authoritative OR recursive DNS server, and not just a recursive DNS, and also use Pi-Hole or AdGuard DNS along with it.
AddOn Question. When using nginx (for example to avoid maintaining all those certifiates on each system individually), all DNS Names would point to the proxy. if I ssh into the target like ssh DNSName, target is the nginx server, not the real server. Are you solving this issue somehow?
Hey Christian good vid Many ways to do it, cloudflare, your method, Here’s how I do it… 1. buy a Synology+ model 8gb pref (you won’t regret it) 2. Synology comes with your own free ddns for life (Must own a Synology) also has quick connect reverse tunnel as well 3. Create let’s encrypt cert free inc wildcard cert on Synology 4. install docker in Synology 5. Create wildcards based on your ddns in Synology (nginx) reverse proxy section“or” can use nginx proxy manager on docker in your Synology 6. If you have behind a Pfsense firewall in which I do create firewall rules also create firewall rules in Synology 7 job Done
Since you ask I have been running local bind, dhcp and smtp sevices for about 15 years. Originally I used an HP-UX system later moving to Centos and recently to Almalinux. I have owned a number of domains and master 'home.' variants for local use. Originally, when Internet connections were slower, it cut dns chatter on the Internet link by caching. The DHCP allows me to assign consistent IP's to my local devices and distribute DNS, gateway, NTP and other configuration. The DCHP on most ISP routers is pretty lame.
Good morning Christian, happy new year. Thank you so much for your wonderful videos. I would like to ask you a few questions. Could we use docker compose instead of docker-compose? Or could we use podman instead of docker to "install" bind9. Is there any relationship between your custom configuration and the cloudflare tunnels I'm using? Finally I would like to ask as a newbie that I am, if you use port forwarding on your homelab. Greetings from Corfu (Greece)!!!
Thank you :) to your question, you can use any container engine that works for you, doesn’t matter whether it’s podman, docker or other tools. I’m not using cloudflare tunnels but I’m using an access proxy that’s cloud based as a secure connection to my servers, which is only for me though.
@@christianlempa I am very happy for your prompt response.🤓 So I guess: no port-forwarding... I would like to see in your channel how to build container images from amd64 to arm64.(I have a raspberry pi😉) I would also like to see a guide yet for vscode and remote access. Anyway... Thanks again for your very informative tutorials!!!
Happy New Year Christian! Awesome video to start the year. I'm waiting on some new gear to change up my lab and will be implementing BIND for internal DNS as well. Are you going to explore setting up a DNS cluster in the future? That way your primary node doesn't resolve DNS queries and is only used for updating the record configuration and then pushing the config to the secondary nodes via zone transfers.
Great video, I might need to try this out. I like the idea of the split horizon. Anyway, more importantly, what terminal is that you are using? I like the auto complete and and sectioning.
What about internal Docker networking? Say I have a MySQL and RabbitMQ server on a machine in my home lab that any of my other dev machines can connect to. Easy enough when running on localhost, just set the HOST variable to the internal domain to that server - but what about in Docker, if I have a service running on Docker and I want it to connect to the same MySQL/RMQ service, how do I set Docker networking to recognize my custom homelab domain?
Hi, etwas überrascht das kein POwerDNS genutzt wird...Docker, HA, GUI und API...Kannst du vielleicht im nächsten Video erläutern. Sonst, wie immer gut und frohes Neues noch...
Fantastic video, Christian! Thanks. I'm not sure where it changed (maybe on Read the Docs), but your link to [Bind9 Configuration and Zone Files] seems broken. Your URL includes: "v9_18_10", but the current RtD link seems to use: "v9.18.10" (periods not underscore). If you're updating anyway, the current version is at: "v9.18.16" 🙂
Did you talk about needing to run the bind Docker container on the Host network? Can’t remember but you need the container to listen on the host IP address to be externally accessible.
Noob questions, what is the main difference between bind9 and something like pihole? Want to try dns server for my home network, which one you suggest? Thanks
Hi Christian, Thanks for great video. I would like to share my idea. I think about exposing my Adguard Home instance. The goal is, all family members should use it as DNS server at hame and outside. Right now I use tailscale but I am wondering what approach would be the best from security perspective to implement it without tailscale. I can see, internet connection is slower with tailscale. Thats why I would like to abandon it. I will be gratfeul for all suggestions.
Hey Christian! Sehr spannend. Ich habe mich vor 1/2 Jahr mal intensiver mit DNS beschäftigt. BIND9 fand ich irgendwie ein bisschen altbacken. Auch brauchte ich etwas mit API um das extern zu füttern. Ich bin damals auf PowerDNS gestoßen, das finde ich prima, vor allem mit der GUI. CoreDNS fand ich aber auch total spannend, da geht eine Menge mit. Vielleicht mal ein Vergleichsvideo?
Nice introduction, thanks! Would like to implement something like this, but would miss the automatic DNS records that pfSense is providing via DHCP leases...
Hi David, this is exactly what I am trying to learn before switching from Unbound to Bind9. How to register dynamic and static DHCP leases and OpenVPN clients to the bind9 as DNS server. Have you ever got that done?
Awesome video! I tried that for myself, and experimented a bit with allowing my DHCP updating the DNS configuration whenever it issues a new lease. However despite setting the BIND9_USER=root like in your example, bind9 was not able to create a journal in the config folder. Setting the permissions of that folder to 777 solved the issue. The newly created ".jnl" file that contains the DHCP update is however created using the root user. That's a bit strange, that root is not allowed to create files... have not found the reason for that yet.
i used BIND9_USER=bind - this sets user according to the group "bind" in the container path /run/named/ - by doing this bind9 was able to write the pid and session files...
You could configure your DHCP server to use dynamic dns for automatic updates to bind. Each VLAN could correspond to a different sub-domain. I don't think you need terraform or ansible.
Thank you! However, I'm not sure whether this would work in my case. I'd like to create a DNS record automatically with the same tool I'm using to create VMs (which is terraform).
@@christianlempa I think a clean method here would be calling an ansible playbook with TF. Looks like there are a few ansible roles out on galaxy for managing Bind9. And you should be able to take the output from TF as an input in the ansible playbook
Could you please describe how to automatically update the dns from a DHCP server? Been looking all over, but searching for dynamic dns just gives hits on using external dyndns...
You're an absolute legend. I've followed two of your videos now and both have been enormous time savers. I'm just getting started with a homelab and setting everything up is extremely daunting and time consuming. You're an incredible resource!
Haha thank you :D I'm glad it's helping you :)
Christian, thanks from the USA! It's nice to listen to someone who actually understands computers, operating systems, and networking. Good job!
I did not know you could use Visual Studio Code to simulataneously access an SSH terminal and access remote folders. You just made my job easier to drop files to my servers. Thank you, Christian.
rm filename
Your are far by the best RUclipsr for this kind of content as you don't just explain how to do something, you explain why to do things and how they actually work and not just saying put this here and there and it'll work.
Love it!!! Shows you have put a lot of time into understanding the concepts properly.
Bit of advice, never use the :latest tag, look up the latest version tag (eg 2.4.2) and use that one instead. Always use a specific version and update in a controlled manner. You do not want to be in a situation where you've accidentally pulled a new version and your config files no longer work with that version. It will save you a lot of headache when something goes wrong or you have to migrate to a new server. You can backup your configs and docker file, but it does not ensure you that those config files will work on another device as you've not defined a version tag in your docker file, you may pull a completely different version. (I'm bad at explaining, please do look up why you shouldn't use :latest to understand it better)
So much this. So many people, and in so many big companies use tag latest and not all of them will listen or care enough to change
There is a middle ground in between the `latest` tag or a tag pointing to a specific release. The current stable nginx release is version `1.23.3`, this version can currently be referenced by multiple tags like `latest`, `stable`, `1.23.3` or even `1`.
If the images maintainers are competent, these additional tags will be updated on every release. To always use the latest nginx release of version 1.x.x, but never accidentially use the releases of another major release (2.x.x), just use the tag `1`.
In a corporate environment, where all changes to the infrastructure have to be managed in a certain way, you hopefully want to control the update process and also the whole image registry and image build process anyways and push new releases to the registry yourself.
🙃🙂
🙃🙃🙃🙃
This image is named bind9 not just bind, so it's implied that the major version is 9, so no breaking changes for you
Hi Christian ! Nice Bind opening clip. But more interesting will be to make a public/local DNS server and segregating trafic will be a nice continuations. Also a good tutorial, as you do, about MX records with DKIM, DMARK , SPF records ;-)
I now use technitium dns server - it‘s open source, easy to install on every os (docker, too), very feature rich, really secure and completely with graphical user interface.
Sounds like a nice project! Thanks for sharing
Fantastic! You explain it in a way that is so easy to understand. When I hade to learn Bind 30 years ago it took forever and was as theoretical as it could be. Thank you again for an excellent tutorial.
Thank you so much, that’s a great compliment :)
I personally use bind9 since very long time but never thought on running on a docker container... what a great idea actually! Great video!
Nice! Thank you :)
Hey you seem like a guy who can resolve my query | Hopefully !
I want to learn to serve a containered app to the internet.
is that really possible?
i believe if i configure dns settings locally good and also configure it with global dns like cloudflare it would really work
will this really work [is that practical / feasible]
will be waiting for your reply
Thanks !
Nice video to kick-off 2023 and a great explanation how to set up a bind server.
It's a long video, and I was only loosely interested, but finished it in one viewing.
One of your best video's ever!
Thank you so much for the kind words! That’s a huge compliment :)
Wow, this is awesome. I was always frustrated with the number of changes needed to have proper DNS resolution in a small network without a proper DNS server. Had I only invested a few hours to understand and setup bind9, this would have saved me a ton of time. Thanks Christian.
You fell from heaven with this video. I planning to local DNS for my devices :) Thank you :)
Haha thanks :) glad it was helpful!
I almost switched my DNS to BIND, but decided to go with Unbound and NSD instead.
Still, great video, configuring services like DNS and DHCP for your own network by hand is really a great learning experience
Glad it helped!
This have been the most useful source I found for setting up an DNS Server, and granted I still had to troubleshoot somethings but this was so helpful and didn't over complicated things
Thank you! Glad it helped you :)
Christian, this was brilliant.
Got my homelab DNS running with this. THANK YOU ♥💙💜💚🧡🧡
Thank you so much! Glad that it was helpful
Hallo Christian, von mir und meiner Familie wünsche ich ein frohes neues, glückliches und erfolgreiches Jahr 2023! Meine Kinder stehen total auf deine IT Beiträge, wir schauen dieses Video gerade zusammen auf dem Beamer. Gruß aus Wiesbaden und vielen Dank für die Mühe : )
Hey, vielen Dank! Ich wünsche euch auch ein frohes Neues, richtig cool, dass ihr so Spaß an den Videos habt :D
Vielen Dank für die hilfreichen Anweisungen, es ist auch schön, deine persönliche Herangehensweise an technische Themen zu hören.
Vielen Dank! 😊
Hi Christian, interesting video. Just an idea: you could install a second Bind9 server and use the VRRP Protocol to cover the fallout of the first one. I‘ve done that with 2 Piholes on different servers with 1 virtual DNS address. If the first DNS server fails, the second one automatically takes command of the name resolution until the first one recovers 🤷🏼♂️. Works flawlessly!
LG aus Luxemburg 🇱🇺
Thats awesome. Do you have a write up about this?
such a good video - watched it last night and have it up and running in 20 minutes for my home lab!!!!!
I'm glad it helped you, man! Thanks again for your support :D
I don't know that bind9 is configured so easy before! Thanks for the video
I'm just getting an error - "open: /etc/bind/named.conf: file not found" and then it exits. I have the file in the folder so I am pretty stumped.
I'm looking forward to watch ansible coming into play. Actually I'll try to automate the whole Bind deployment. Thanks for this great video.
Hi, thank you for this great video! I'm actually preparing to provide an own DNS server (also planned to use the Ubuntu/bind9 docker image) for my local network.
You give many useful tips that will help.
So again: thank you and you have a new follower now 😉.
Cheers from Germany!
Okay, it seem's that dnsmasq is blocking port 53 (I need to use piVCCU)....
Don’t forget to add the docker networks to the internal ACL list, or you may end up like me wondering why portainer does not resolve 😅 BTW I use views to control who sees what. As a side note if you are privacy cautious do not use forwarders. Bind is capable to resolve on its own. You may need to setup a hint zone to speed things up a little.
Good tip xD
Perfect hit - i was looking for that currently. Thank you 🎉
You’re welcome 😊
I followed your tutorial and it worked like a charm. Great tutorial! Thank you.
that's great! next topic could be how to issue a certificate from let's encrypt
I have been waiting for this for so long! Thank you.
Hope you like it!
One thing you may want to look at for outside requests using an SSL DNS server. I have the outside request routing through STunnel. This will stop anyone from logging your DNS requests
One of the reasons why I use unbound in pfsense.
Gru you are killing it.
:D
Great video! This is something I have been wanting to do for my home network. Thank you for creating this tutorial!
Thank you! Glad you enjoyed it :)
I love this channel, for more tutorials of this style, thank you very much.
Thank you so much :)
thank you for taking the time to make this video. it helped me
This setup looks neat, think I'll be setting up my own DNS resolver this weekend! 🌟😍
Awesome! Tell us how it goes (discord) :D
Really lovely walkthrough of your process. Thankyou for sharing.
Happy Saturday brother
Thanks, you too!
I use NextDNS as I can use it to protect my kids from nasties on the Web, both on my LAN and when they roam.
It's an easy package to install on OpenWRT. I ended up doing split horizon without even knowing what it was by putting my internal services in the hosts file on OpenWRT.
It works so I don't want to mess with it but would really like to move away from OpenWRT.
This has given me a lot to think about. Thank you for the guide 👍
You’re welcome! Hope it helps to optimize your setup :)
This is exactly what I needed. Thanks Christian!
Please do a full home lab tour video with this included :) Everything thats running in your homelab!
Great video, I use pihole’s local dns features. Works great :)
Danke, genau was ich gesucht hab. Da Bind9 nur die Config Files braucht kann man das auch Super als Infrastructure as Code direkt aus dem Git hochziehen lassen. Perfekt Terraform für die VM und dann Ansible & Docker um Bind9 zu deployen. So macht Infrastruktur Spaß :)
Hey Chris, have you tried integrating PowerDNS for graphical management of DNS? It would be interesting to see it in a video. I have it set up in my lab with KVM/LXC and it's very useful.
Several days ago I tried to find good solution DNS server + simple web UI (preferrable is not 3rd party). And found that there is only one solution for this, called SnitchDNS. And decided that the best option is PowerDNS + 3rd party PowerDNS-Admin. Might Chris do not need UI for DNS management, because its his homelab with one user.
@christianlempa a few notes:
7:26 Small nit-pick: it's "I. S. C." (Internet Systems Consortium) and not "I. C. S." You mentioned the incorrect acryonym a few times.
18:30 Try using dig (vs nslookup), since you're using BIND. IMHO (and as a former DNS admin for a large ISP), dig is more powerful and streamlined. For EL distros, you'll find it in the "bind-utils" package. Not sure about Mac or Debian-based distros like Ubuntu.
19:30 FYI, the reason why you can use .home, .corp, and .mail (but not .local) TLDs on your private network is because ICANN's board found they were already in prevalent use, and attempting to introduce them publicly would be "high-risk" due to potential name collisions. Originally, these TLDs were not listed in any standard (or RFC) and were technically off-limits (even though people still used them), at least until ICANN Resolution 2018.02.04.12 stated "the delegations of such high-risk strings would be deferred indefinitely."
21:15 Use named-checkconf and named-checkzone. There's probably a config option or extension in VScode to automate this, or you can just add a precommit githook.
31:30 I'm surprised you went with BIND over CoreDNS, since I know you're interested in Kubernetes and especially given your automation aspirations (check the ectd plugin for use outside of k8s).
It would be great to be able to like twice, this is a very good project.
Haha thank you so much! :)
Hey, just a tip. If you want to show console input/output, maybe move the window up a little, because if you watch the video with subtitles, you can't at all see what's going on.
Finally a technical guy not going assembly lang
Thanks Chistian!
How about your SSL certs? Now i'm using NGINX Proxy manager with an subdomain wildcard to my home dns entry. Are you still facing something public? Or are you using wildcard certs with Letsencrypt with an dns challenge?
Happy new year and great start with your awesome video and wealth of info as usual.
Happy new year to you too! And thanks :)
Damnn, this bring back memories. I have an class where we configured an linux machine from the ground up, and dns with bind9 was one of the configurations we have to do, sadly at the time I don't give much value to it and only remenbered now
I've been running bind for years now. I use a caching dns config to speed up things. I deploy my services via Ansible which also manages my zones via Ansible templates. Traefik is awesome in that chain to facilitate reverse proxying. Really great recap on all the intricacies!
Hi! I am running in a problem that it looks like you solved. I use a dockerized NGINX proxy manger. I setup bind9 but I cant make the 2 work together. what should I do?
@@LucaGaetanoCapula I am strugling with the same thing not sure what I ahm doing wrong.
I'm way behind but I'm also going back to bind9. We used it at work a couple of years ago and I laughed at the old half-dead guys running it.. now I'd love to have it that simple and being able to easily manage it automagically with Ansible or Terraform.
I like your videos. I watch them.Thank you! Just one thing about audio, I can improve it just for free. It's no problems for me, I can help.
Thanks for the demo and info, have a great day
Thanks, you too!
Setup PI Hole with Unbound. This is the real deal. :D
It was super tutorial, Thanks for this❤
You're welcome 😊
Thanks a lot, Christian and a blessed 2023. Do you planned a second part with explaining split horizon and things like TLS w/LE for our local labs (0:52)?
uhm, my mistake... with the public domain and a subdomain (like home. or demo.), TLS works after setting this up, I guess^^
Great video, I use Adguard as home DNS
Thanks for a great video. I am using ansible to implement this - almost working.
Excellent!
Thanks Christian, this is an excellent video. I may want to have a Bind9 server cache all the external DNS entries often used across my local network. Is there an automated way to have external entries refreshed after TTL has expired, or is this a bad idea?
Love your videos, I've learned a ton from you.
Thank you so much ❤️ I'm glad my videos help you!
Great video Christian! I'm looking at creating implementing my own DNS service in a private subnet in the cloud (rather than at home), which I connect to via a VPN, and I'm considering doing this. I'm sure there are probably some tools offered by the cloud provider (I'd rather not use those, in this particular cAWSe, or maybe by the VPN server (openvpn access server), but bind9 seems like a solid way to do things. I've yet to watch your Cloudfare Tunnel videos, so maybe those have some info re. DNS while connected remotely.. As always, I learned a ton; looking forward to the next video!
Thank you! :) Glad it helped you!
Hi Christan, danke Dir vielmals, hat mir sehr geholfen. VG!
Das freut mich!
I'd put a caching server like pihole on the inside and give out that IP to clients. That creates a consistent model for internal and external/3rd party domains: client->cache->[main cache]->authoritative server. This scales better if you go multi-site as you keep your authoritative systems in the data centre and put dumb caches out on sites and you can put your authoritative server somewhere nice like a DMZ, where it can publish out to the internet and do zone transfers to your ISP if required. Of course you can zone transfer to the DC (for things like dhcp dns registrations), but I think its neater centralise first if possible.
You probably want to protect your primary DNS server with a DMZ which only allows outbound zone transfers to secondaries and doesn't answer queries itself. If someone hacks your DNS, you're toast.
Thanks.. always as interesting, this is how I drive with bind9
I've been running Bind for a few years now and am completely satisfied. I send the questions to the Nginx reverse proxy which puts on the ssl certificate before servers.
Awesome! Sounds like a great solution :)
Hi Christian, really like you video and passion about technology. Just wonder do you have a tutorial on a quick ways to spin up new Ubuntu server 22.04.1 LTS from cloned image with sysprep so all the UUID/MAC address will be unique for each machine?
I've been using Technitium DNS, I definitely prefer it over BIND
Why? I have played with Technitium DNS too and I like it feature set! Do you use it's Dhcp, too?
@Christian, you’re an amazing teacher. You take some pretty complex subjects and make them not only understandable but exciting to try (at least for nerds like me). One question. You are using two different programs. One for terminal commands and one for text files. Both have some sort of auto-complete working on them. Can you share what two programs those are? I’m just curious.
Thanks for another great video.
They are WARP termial and VS Code editor. Btw, if you not use macOS, and bash, zsh, or fish is your default shell, you could try oh-my-bash, oh-my-zsh, or oh-my-fish to enhance your default shell. The basic auto-complete script is included in enhancements, and you can also add your customize auto-complete scripts to the configuration file.
Thank you so much! And yeah Shawn actually explained the tools perfectly :)
Great video! Very interesting stuff to learn 😊 thanks for your time to explain it into detail. Also happy newyear 🎉
Happy new year to you too! :)
Hey Christian! Nice video! I'm using Pfsense which supports wildcard certificates.
While bind9 will certainly do the job more than well, another lighter alternative is unbound (by NLnet Labs), which is also very flexible. Most people can actually do with a DNS resolver instead of a full DNS server. 👍
Unbound would be the less involved an sufficient solution for most homelabs.
@@slickheisenberg8208 Yeah I'm running Unbound myself! 👍
Hey Christian! Nice video! I can see this fitting perfectly into my own lab :-). Just wondering if you'd consider a 2nd container (or K3S) orso as a secondary (Internal) DNS (to maintain HA). I'm not sure if you can configure that as well in your Sophos? (perhaps round robin). Maybe this is an overkill, but you keep mentioning that this is something you'd want to scale up to 'enterprise' levels. ;-).
Hi Christian, what is the terminal completion you are using? Looks so useful!
and beatutiful, different with other terminal.
Love the Instructions. Why not run your own recursive server? The bind9 configuration is now a forwarder
I agree.
@ChristianLempa Great video! Which file explorer/editor are you using in the video?
Hi Christian, I have one mir question: in the compilation of DHCP with Sophos XG and bind9, is it possible to get not reserved ip addresses from dhcp, this ip, hostname and domain is registered und bind9, so that this ip and this hostname can be resolved? I try to not reserve ip addresses and I do not want to create manuell bind enties. For me this works right now only with dhcp and unbound and only when both services run on the opnsense.
I am having good results since switching to Unbound. Be careful. When using a public resolver like Quad9 or Cloudflared, your ISP can still transparently proxy your DNS requests. This is referred to as a DNS leak. With Unbound, or Bind9, the DNS server on your network contacts different DNS root servers online and prevents DNS leaks. For some reason, I could not successfully use DoH or DoT (within AdGuard Home) without my requests being intercepted by my ISP's DNS proxies, as proven by the online DNS Leaktest websites. I would love to migrate from Unbound to Bind9 as BIND acts as an authoritative OR recursive DNS server, and not just a recursive DNS, and also use Pi-Hole or AdGuard DNS along with it.
AddOn Question. When using nginx (for example to avoid maintaining all those certifiates on each system individually), all DNS Names would point to the proxy. if I ssh into the target like ssh DNSName, target is the nginx server, not the real server. Are you solving this issue somehow?
do you have the same thing in docker ?
Could not open '//run/named/named.pid'
You need to place named.conf into ./config subdirectory.
Hey Christian good vid
Many ways to do it, cloudflare, your method, Here’s how I do it…
1. buy a Synology+ model 8gb pref (you won’t regret it)
2. Synology comes with your own free ddns for life (Must own a Synology) also has quick connect reverse tunnel as well
3. Create let’s encrypt cert free inc wildcard cert on Synology
4. install docker in Synology
5. Create wildcards based on your ddns in Synology (nginx) reverse proxy section“or” can use nginx proxy manager on docker in your Synology
6. If you have behind a Pfsense firewall in which I do create firewall rules also create firewall rules in Synology
7 job Done
Since you ask I have been running local bind, dhcp and smtp sevices for about 15 years. Originally I used an HP-UX system later moving to Centos and recently to Almalinux. I have owned a number of domains and master 'home.' variants for local use. Originally, when Internet connections were slower, it cut dns chatter on the Internet link by caching. The DHCP allows me to assign consistent IP's to my local devices and distribute DNS, gateway, NTP and other configuration. The DCHP on most ISP routers is pretty lame.
Good morning Christian, happy new year. Thank you so much for your wonderful videos.
I would like to ask you a few questions.
Could we use docker compose instead of docker-compose?
Or could we use podman instead of docker to "install" bind9.
Is there any relationship between your custom configuration and the cloudflare tunnels I'm using?
Finally I would like to ask as a newbie that I am, if you use port forwarding on your homelab.
Greetings from Corfu (Greece)!!!
Thank you :) to your question, you can use any container engine that works for you, doesn’t matter whether it’s podman, docker or other tools. I’m not using cloudflare tunnels but I’m using an access proxy that’s cloud based as a secure connection to my servers, which is only for me though.
@@christianlempa I am very happy for your prompt response.🤓
So I guess: no port-forwarding...
I would like to see in your channel how to build container images from amd64 to arm64.(I have a raspberry pi😉)
I would also like to see a guide yet for vscode and remote access.
Anyway...
Thanks again for your very informative tutorials!!!
You are rocking that turtleneck!
Haha thx :D
Happy New Year Christian! Awesome video to start the year. I'm waiting on some new gear to change up my lab and will be implementing BIND for internal DNS as well. Are you going to explore setting up a DNS cluster in the future? That way your primary node doesn't resolve DNS queries and is only used for updating the record configuration and then pushing the config to the secondary nodes via zone transfers.
Great video, I might need to try this out. I like the idea of the split horizon. Anyway, more importantly, what terminal is that you are using? I like the auto complete and and sectioning.
nevermind, I found warp which I'm pretty sure it is.
What about internal Docker networking? Say I have a MySQL and RabbitMQ server on a machine in my home lab that any of my other dev machines can connect to. Easy enough when running on localhost, just set the HOST variable to the internal domain to that server - but what about in Docker, if I have a service running on Docker and I want it to connect to the same MySQL/RMQ service, how do I set Docker networking to recognize my custom homelab domain?
Great video Chris ! , yet may be implementing our own Local DIY CDN is a good perspective to avoid using cloudflare for full privacy.
Thank you! Currently no plans to do that
@@christianlempa All right! Think of that in a future... Best regards.
Fantastic video. Thanks much.
👌 Mit dir müsste man mal ein Bierchen trinken :D
Danke für alle deine interessanten Videos!
Haha, wenn ich anstatt Bier auch Cola trinken darf gerne :D
Hi, etwas überrascht das kein POwerDNS genutzt wird...Docker, HA, GUI und API...Kannst du vielleicht im nächsten Video erläutern. Sonst, wie immer gut und frohes Neues noch...
Fantastic video, Christian! Thanks. I'm not sure where it changed (maybe on Read the Docs), but your link to [Bind9 Configuration and Zone Files] seems broken. Your URL includes: "v9_18_10", but the current RtD link seems to use: "v9.18.10" (periods not underscore). If you're updating anyway, the current version is at: "v9.18.16" 🙂
Hi Christian. Great video. Please share the name of the text/proyect editor you used in the video. Thanks.
Did you talk about needing to run the bind Docker container on the Host network? Can’t remember but you need the container to listen on the host IP address to be externally accessible.
Very clear video. Thank you!
Glad it was helpful!
Very interesting video. Thanks!
Glad you enjoyed it!
Noob questions, what is the main difference between bind9 and something like pihole? Want to try dns server for my home network, which one you suggest? Thanks
Hi Christian, Thanks for great video. I would like to share my idea. I think about exposing my Adguard Home instance. The goal is, all family members should use it as DNS server at hame and outside. Right now I use tailscale but I am wondering what approach would be the best from security perspective to implement it without tailscale. I can see, internet connection is slower with tailscale. Thats why I would like to abandon it. I will be gratfeul for all suggestions.
Hey Christian! Sehr spannend. Ich habe mich vor 1/2 Jahr mal intensiver mit DNS beschäftigt. BIND9 fand ich irgendwie ein bisschen altbacken. Auch brauchte ich etwas mit API um das extern zu füttern. Ich bin damals auf PowerDNS gestoßen, das finde ich prima, vor allem mit der GUI. CoreDNS fand ich aber auch total spannend, da geht eine Menge mit. Vielleicht mal ein Vergleichsvideo?
PowerDNS ist auch die bevorzugte Lösung. HA fähig, Docker-fähig, GUI und API.. alles was man braucht.
Is it possible to create DNS cache to have lets say more commonly used DNs entries saved locally in our cache?
Nice introduction, thanks! Would like to implement something like this, but would miss the automatic DNS records that pfSense is providing via DHCP leases...
Hi David, this is exactly what I am trying to learn before switching from Unbound to Bind9. How to register dynamic and static DHCP leases and OpenVPN clients to the bind9 as DNS server. Have you ever got that done?
Awesome video! I tried that for myself, and experimented a bit with allowing my DHCP updating the DNS configuration whenever it issues a new lease. However despite setting the BIND9_USER=root like in your example, bind9 was not able to create a journal in the config folder. Setting the permissions of that folder to 777 solved the issue. The newly created ".jnl" file that contains the DHCP update is however created using the root user. That's a bit strange, that root is not allowed to create files... have not found the reason for that yet.
i used BIND9_USER=bind - this sets user according to the group "bind" in the container path /run/named/ - by doing this bind9 was able to write the pid and session files...
You could configure your DHCP server to use dynamic dns for automatic updates to bind. Each VLAN could correspond to a different sub-domain. I don't think you need terraform or ansible.
Thank you! However, I'm not sure whether this would work in my case. I'd like to create a DNS record automatically with the same tool I'm using to create VMs (which is terraform).
@@christianlempa I think a clean method here would be calling an ansible playbook with TF. Looks like there are a few ansible roles out on galaxy for managing Bind9. And you should be able to take the output from TF as an input in the ansible playbook
Could you please describe how to automatically update the dns from a DHCP server?
Been looking all over, but searching for dynamic dns just gives hits on using external dyndns...