How to setup DNS at home with Bind and Webmin on Ubuntu 20.04

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi youtube i'm back with another uh video on uh simple dns for your home lab and i believe this is better than the uh the other two that i suggested which was uh pfsense and uh zentyo let me go ahead and show you what i mean here so i i have here a ubuntu 20.04 server built and it has nothing on it and basically it's a 2004 it's a vm has four giga ram 20 gigabyte disk and is using a static ip address something you would uh build that home on in vmware player proxmox virtualbox esxi you you choose what you want to use basically you can just create this as a vm you can probably even do this on the raspberry pi but um so build yourself with 2004 give it the 4 gig of ram 20 gig of this and the static ip and then remember to enable ssh because i'm going to paste or at least i enabled it because i need to log in with putty and i'm going to paste my uh commands uh but basically i'm going to show you bind 9 on uh webmin on ubuntu 2004 and it is so much more simpler than the previous example i gave you of a dns for home lab so here's the server brand new server i'm going to whack this after i'm done so let me just go and make this a bit bigger oh so first after you build the server the first thing you want to do is probably just update it so this is just a command to make sure it's up to date update and upgrade okay once that's done you're going to want to install webmin dependencies and i'm going to post these notes into the video description but you can find how to do this on on on the internet with google how to install webmin and how to install bind okay first dependency done now i'm going to add the webmin repository much more easier once you have the cheat sheet here just copy and paste right in whoops added in a return there all right then once those two dependencies are done you can install whitman this gets the latest version straight from their site website and then you can check that it's running so it's active okay um the next step is a firewall to opening up the firewall for the webmin application but um with the with 2004 um i don't think the firewall is on by default uh at least i don't have to open anything and it still runs so i'll leave this as an option in my notes but um i know i don't do that any uh with the 2004. and then once you're done you can go to the webmin webpage which is on port 10000 and log in right so i'll use microsoft edge on my tester test machine here and it's an https call um so the ip of this test server is 31. and then you use your the account you used or created when you installed ubuntu and this is whitman hopefully some of you have seen this before um this just gives a gooey interface into some of the most common things that you would use or things you might tweak in in linux right so again that way you don't have to worry about command line so first thing i'm going to do is refresh the modules all right once the modules are refreshed and you go to the unused modules and you select bind dns server here and you have an install button click on that and it will look at the packages that you will need to install and it tells you what they are and then you can hit click on again to install it now and when it's complete i'll tell you in the bottom here successfully installed four packages then i would go back and refresh the modules if you don't do that it might not show up up where i'm going next you go to servers and if you don't see buying 9 you need to go refresh the module so click on buy nine and this is a unconfigured buying instance right first thing you want to do is create a slave zone that's right first thing you want to do is create a master zone and this is going to be a forward zone and i'm just going to use lab.local you can use home.local or whatever your domain is that you want to support at home in your home lab you do need a an email address and i'm just going to put some dummy information here test dummy at dummy.com uh and then everything else you can leave um default but just remember this is your first one is your forward uh lookup and then you put in your domain there so create and now it's created so then i go back to the zone list and it shows over here lab.local now before i even go and enter any records i'm going to create the reverse lookup so then i'm going to go back down here now that you have something in here create master has been moved over a little bit so you're going to go create master zone again but this time you're going to create a reverse lookup zone and you're going to do 192 or whatever your network is if you have a 10 network it could be 10.10 or whatever but for me is 192.168. and this this machine's on the 5 network so i'm just going to start with this one first obviously you can put any number of subnets in here and you don't need the zero so i just need 192 168. no dot zero just 192.168.5 that's it again you need to put in an email address and i'm just going to put test on me i'm going to add dummy.com you can put a valid one here if you wish and i'm going to create this reverse so and remember you need to select reversed over here i'm going to create this so now that we have a reverse zone created for the subnet that i want to do i am going to go back to here and sometimes you need to apply the configuration in this case i probably don't have to but i'll do it anyway i'll click on apply the configuration um now let's just go put in a record right so i have this pc i'm on and this pc is on 5.23 right and we'll enter that in our server here so we're going to create and this is called lab pc um and i'm already in lab.local the domain right the zone so i'm i have a lab pc.lab.local and the address is going to be 192168 and this one is in 23. and then it's gonna update the reverse yes so that's why i wanted to create the reverse zone first right so remember i created it for the five now if this was something else you would create those first and create this record all right it's successfully created and then they let you create more because you're probably creating a whole bunch at the same time so now let's take a look at it you know lab.local you have one address that you just created labpc.lab.local and here's the address that we added in there now let's take a look at the reverse the reverse is 192.168.5 you go in there and there's already a record and it is 192.168.5.23 and this is your lab pc now to check that your dns is configured correctly you want to click on check bind config and it will tell you if there's any errors in the config file okay we have no error so that's good some of the common errors i've seen is something the dns server or the name server doesn't have an ip address um so if you're in here your name server might not be listed or have a correct you know ip address so this one my server is called test dns and uh it's actually in a different domain but it's supporting this uh zone right but again it didn't have any errors so i don't have to worry but that's one of the common areas you'll see is that it doesn't know where that dns server is so you might have to actually add a dns record for that d uh for that dns server so you might have to go into here and add an address and add in the dns server and give it an ip for it to resolve that server all right in this case we didn't get any errors so we don't have to do that now one thing that i wanted to mention someone asked about the recursive uh i believe dot bind and and you have to go research this on your own but i believe bind by default um does caching and recursive lookups so um the settings for recursive is default and from my under my understanding the default setting uh is going to be recursive and caching so it's up to you to go figure that one out i i i believe what i've read but you'll have to read up on your on your own for that to make sure you know and then whenever you're you're done you can always apply configuration just to make sure that it's set so let's go to the pc so in here we're going to go look for that value right so we're going to go ns lookup and that's the default the dns server that's on now so to change it i'm going to do server 1.21685.31 so now that way on that server then we can say um you know what is lab pc that pc is 5.23 and you can also check the full name of it lab dot local and it's not 23. now also be aware i did not secure the dns server right this dns server by default is not secure um you can do an ls on the whole zone right and it will well um alice not local and it will show you every address of lab.local so just be aware of that right it's not secured it will allow the lookup of the um of the entire zone so you'll have to lock that down um but you know most people have this internally uh for their own servers so i i can't i don't expect that this will be public right this is public that's a you have a another uh can of worms to kind of figure out how to uh make this more secure i would never put this on the internet unless i read a lot more on dns and buying nine and how to make it secure but just be aware that you can do that so you can enumerate every record in the in the zone so hopefully this has helped somebody um this is much more easier and much more quicker to create a dns server for your home lab or even for your home like for instance if you have a nas i don't know how many of you noticed that if you have a nas but no dns refers to your nas it could take a while for windows 10 to find it on the network resolve it and then connect for you to authenticate to the nas if you have a dns home dns server like this and add your nas in here with an ip address and and have all your servers point to it uh you you'll be able to resolve your nas much more quickly but just be aware if you do use your bind on webmin dns server here as your primary server remember to configure a forwarder right so you're going to want to go to like the quad 9 dns servers or to the google google public dns servers so that you will forward out to those when your local server doesn't know the answer it will go forward out to those servers and remember to be redundant and have extra ones ring and whoops and if you have a third one put in the third one all right hopefully this has helped somebody take care
Info
Channel: dancetracks
Views: 12,810
Rating: undefined out of 5
Keywords: dns, bind9, ubuntu, 20.04, webmin, homelab, home lab
Id: ZG7E5G_rM8M
Channel Id: undefined
Length: 13min 55sec (835 seconds)
Published: Mon Sep 14 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.