DuckDNS for Routing Internet Traffic to your Home Lab with Dynamic IPs from your ISP.

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] it's your open source advocate and i'm back with another video and today we're going to talk about dynamic dns so a lot of times when you're actually trying to run your own home lab you might have an isp that changes your actual ip address on a regular basis sometimes it's multiple times a day sometimes it's a couple of times a week if you're like me where i do have an actual an actual dynamic ip address that gets changed occasionally it may not change for months but then something could happen like a power outage that takes it out and and basically when you re-authenticate back to your isp when the power is back it pulls a new ip address because the timeout has lapsed and that ip address is gone the problem with that is when you're trying to run services from home and you want to use a url but you're trying to point that url all the time to your public ip address and that public ip address changes suddenly your your your suddenly your urls don't know where to point so you try to go to mycoolthing at myhome.org and that used to point to 111.2020.9 which is not a real ip address but you know go with me and now your new ip address for today has become 111.2082.97.804 so now your url is pointing to the wrong place and you have to go and manually update it and a lot of times you don't realize that it's changed until you're away from home and you're trying to access something back at home which makes it much more difficult to go and actually update that dns and then you've got to wait for dns to update and so on and so forth so what dynamic dns does and what duck dns does is it gives you a url that you can use for your home lab and then it automatically updates using a service that's running inside of your home to say hey what's your ip address right now and it checks about every five minutes and it says hey what's your ip address what's your ip address and whenever it gets an update for that ip address it goes out and it tells dns like hey my p address changed let's update this and then duckdns updates all of this stuff and the next time you try to go to the url it says hey i know where that is so basically it just kind of does all the stuff that you would do manually but it does it for you automatically so it's really a cool service and if you really are serious about running a home lab but you don't want to have to buy a business level internet connection to do it then a dynamic dns service is something that's going to help you a lot and i've been promising to do this video for a long time but we're going to get into how to get this set up and installed here in just a minute i want to say thank you to all of my subscribers and all of my patrons over at patreon seriously you guys make this so worth it for me to do these videos every week i really truly enjoy it and i just can't say thank you enough if you're enjoying these videos subscribe let youtube know that i'm doing a good job by subscribing to the channel plus you'll get notified when i have new videos coming out and finally if you're enjoying what i'm doing give it a like just click on that thumbs up and that way youtube knows that you like it and they'll pass it along to other people that might enjoy my content as well i really appreciate it thank you again let's get started so as always we're going to do this with docker docker just makes it so easy to run lots of different applications and web applications on hardware that doesn't require quite so much of a commitment from a financial side you may you may have an old laptop laying around that you don't realize you could run actually a lot of containers on now if you're if you're trying to run a website where you want tens of thousands of people to be able to hit it and access it and pull down media and stuff you need to look at a vps or you need to look at a business level um internet access you know you can't just do that on your home internet access most of the time now some people have gigabit internet access and maybe that's enough for you to do what you're wanting to do but if you just have like me where i've got 200 megabits that's for me to access at home i'm not trying to to set up something that tens of thousands of people are trying to access if i am it should be extremely low on the requirements of what those people are going to be pulling down from my servers so that it's not trying to use up on my bandwidth to do that so what we're going to do is we're going to set up duck dns today and here it's going to show you their supported architecture so they've got amd64 they've got amd 64 or it's arm sorry arms arm 64 v8 and rm 64 v7 so basically your raspberry pi boards um you're going to have your your odroid your orange pi any kind of the the pi single board systems the arm systems are going to run this as well but you can also run it on amd 64 stuff so if you've got a vm running or if you just got a machine running where you've got docker going this is going to work so that's the good news you can do this kind of any way you want to so they talk about the application setup i'm going to make this just a little bit bigger for those of you kind of checking it out on your phone this still may not be quite big enough for you to read but hopefully so there's kind of three steps which is great right first is go to the duck dns website and they give you a link right here and i'll have a link in the show notes in the description but you're going to register your sub domain so basically your sub domain is going to be part of dns's domain it's not like you get to have your own special domain but i will cover a way to do that in another video as well so don't worry but you're going to register your sub domain and then you're going to get a token for that subdomain the next thing you're going to do is you're going to create a container with your sub domain and token so we're going to create that docker container that we're talking about using this setup and then finally it's going to update your ip address with duckdns every five minutes which is awesome so mine doesn't change that often we may not be able to actually see it change today but you'll see how this functions and how it works and you can follow these steps to get it set up and working and then if you're if your ip address changes all the time this should be something that functions pretty well for you so the first thing we're going to do is this step right here now i do want to say we're going to do this in docker we're going to do it in the cli but you can also do this in pertainer if you want to install duct dns again i use these templates from and i'll go here here's the settings i'll get this link and i'll paste it in the show notes so that you'll have a link to this but you can paste it into your pertainer settings and then go back to your pertainer and actually set up your dns using portainer as well so then you once you've got that you go to your app templates mine has this little switch off every time for some reason so just click it on and you'll see your app templates and then you can go here to the search and you can type duck and there's duck dns right there so you can click on it and you'll see that it's got some stuff already set for you and it's of course got all the stuff you need for the template now there's ports and things like that i don't think you need any of those things but we'll go through the docker command as well now the one thing you will have to set up are a couple of things where you need your dns sub domain that's going to be an environment variable and you're going to need the token so the dns token so that's right here so you'll put in your subdomain here and your token here you'll go down here and you really just hit deploy the container and it's going to go but we'll also do it in the cli and the terminal for you guys just so you can see how that's done first thing we got to do is open up this website so i'm just going to open that in a new tab and we'll check out the duckdanis website together here it says free dynamic dns hosted on aws so they host their stuff on aws be aware of that so it's checking in at an aws website but that's just hosting this that's where they host this thing so it can keep up with your dns and it says the login with reddit is no more and i don't know why but it looks like they have a legal request so you can become a patron and support them on patreon so again if you like these open source projects if you like my content go out and support me if you like the open source projects go out and support them a dollar a month five dollars a month you know anything you give helps and as more people do it that adds up over time and that just makes it easier for for everyone for me to make content for these guys to keep making this software so just kind of keep that in mind as you're looking at these things so right here they do have their terms of use and their privacy policy so if you're concerned about that you can check out those links and read about that as well so you've got several different ways to sign in you've got sign in with patreon sign in with twitter sign in with github they used to have user edit but as you can see it says it is no more so don't don't sweat the reddit stuff but then they also have google so if you're watching this on youtube and you're able to comment and you have a google address already i have google addresses i would love to do google someday but a lot of that stuff is just tied to everything you do but you do have github options you have other options if you want to use something else to sign up for dns so feel free to do it the way that you want i'll go over and use my google authentication here it doesn't bother me to do that so i'm just going to click on this thing and it's going to say hey are you sure you want to do that and google says yep that's fine so that's cool um so now it says please complete the recaptcha so it says this site is so yeah i'll just do recaptcha um and it looks like we're okay so now i get to pick my subdomain and you see it says duckdns.org so i'm going to pick a subdomain for duckdns.org and then i'm going to click on add domain so again i'll make this a little larger for you guys just so it's easy to read but you can see here here's my email address okay um type is free so it's free all right and then here's my token so this is just going to be a test site don't worry i'm not i'm not worried about hiding this token i'm not going to use this full time i'm going to set it up and i'm going to destroy it you're not going to get to my stuff don't worry 14 seconds ago is when my token was generated and it was created on this day at this time so you can see all this information when you do this for yourself as well right now i don't have any information about my current ip or anything but i'm going to create a subdomain so first i've got to find a subdomain that i can use because right now it's at you know.dns.org so i'm going to try to create this sub domain and let's just call this o s i a let's see if that was taken will tab out i'm guessing it'll try to tell me if if not it'll tell me when i do add domains i bet but open source is awesome awesome.duckdns.org i'd probably be pretty lucky if that actually works um looks like it might have taken it yeah domain osi.dns.org added to my account so now i i am the owner of osia.dns.org now i think these only last for a certain amount of time and if you're not actively using it it's it's going to go away and somebody else can grab that at some point um so so don't uh don't worry about that either but you can see here currently here's my ipv4 address i don't have an ipv6 address and it says it changed one second ago but that's that's because it actually finally read my address so now i need to go and set this up so i've got this token and i've got my subdomain so i'm going to copy this token right here i'm just going to do control c to copy or of course you can right click and copy however you like to copy things it's just out of a browser and then we're going to go back and we're going to say okay now how do i set up the actual duct dns so here they've got a version 2.1 docker compose file so if you prefer docker compose there's the way to do it if you prefer docker run then here's the docker run command you can do this either way as long as you replace those two those two things that i told you about which is again this is optional you don't have to use this as telling you these are optional time zone you want to set up probably and then you need to set up your sub domain and your token so they're telling you here's the things you need to replace and it doesn't matter where you do it but here's the places where you need to to replace those things so let's just go with this one and we will copy this and so i've copied my token that's the bad part uh so what i'm going to do is i'm going to go here i'm going to clear this out i'm going to make the font a little larger for you guys so that it's bigger on the screen and i'm just going to do mkdir and i'm going to call this duck dns put a cd into dns and i'm going to create a file called dockercompose.yml so i'm going to say nano docker hyphen compose make sure it's all spelled correctly.yml and in there i'm going to center click to paste all of the stuff that i just highlighted in the background so in linux that's one of the great things about it you can highlight something and then on the mouse wheel if it has a click or if you have a third mouse button in the middle you can center click on that mouse wheel and it'll paste anything you've highlighted but i don't believe it takes the place of something you have copied to the clipboard so i'm going to go up and i'm going to get to my token spot right here which is the thing that i copied off the page i'm going to do control shift and v like victor to paste in my token there it is and then you can do multiple subdomains here but i just did one so i'm going to do osi.dns.org that's my subdomain i'm going to change my time zone i am not in europe london um i am in america slash chicago is my time zone i'm actually on the whole other side of the country from there down on the southern border but that's my time zone the puei pu id and pgid i'm just going to leave with a thousand it's fine it's optional it's not something we have to have but i'll leave it oops i'm hitting the wrong button let me go back make sure you hit the correct button if you're going to get rid of some comments here i'm just going to remove these comments they probably don't hurt anything honestly but get rid of them there we go here's the container name that it's going to be here is the image it's going to try and use and everything else here looks good now it's going to say here's one thing we have to do we have a volume that we need to map so be very careful about this so it says log file false that's fine i'm not going to use a log we can just erase that now if you're having issues with it you can change that to true and it should create a log file that you can go check out so on this on the left side only of the colon when you're doing anything with these types of files with docker the right side is inside the container so the container just think of it kind of like its own little special machine it needs to have these paths set the way that they are but on the left side this is your host so this is going to map a place on your host to a place on the container what i like to do is just take this part here out and then just put in home brian that's where i just created this duck dns folder so now i've got slash home slash brian slash duck dns slash config and it's going to map that config there again this says optional so if you don't want it you can take it out but and i mean you can take out the whole line i'm taking out the comment but you can take out the whole line if it says optional and then it says restart unless stopped which is what i like so sometimes i stop it and i want to do something to it and then i'll restart it now the only thing that's left is i have um watchtower running and i don't like watchtower to update things for me automatically because it can break stuff but in this case i don't mind if it updates doug dns i don't feel like that's going to break anything and if it does it's not going to be the end of the world for what i'm trying to do but if you're worried about that you'd want to put in the proper label as well so that watchtower doesn't update it but just something to keep in mind so everything here looks good i think we've got everything set up this is how i would this is how i'm going to run it so what i'm going to do is i'm going to run it this way i'm going to do control o to save and make sure the the title looks correct i'm going to do control x to get out of nano and then we're just going to do docker compose up hyphen d so it created a network for us you can see that right here dns underscore default with the default driver and then it went and pulled down the duct dns latest so it's getting that stuff it goes down and it says all right i'm downloading it i'm pulling it and i've extracted it and now i'm running it and it says it downloaded a newer image which is fine by me and it says done so it should be running so now we can do docker ps if you don't have a portain or you can do docker ps like this and that means show me all of the containers that are running which i have a lot but if we just kind of scroll up here we should see one that says duck dns and there it is right there there's my duck dns container and it is running and it says that it's been up for 27 seconds so that means it's up and running so that's great now is there anything to look at for it other than this not that i'm aware of but we can also go back and we can say let's just look at it from the portainer perspective so if i go into my containers we should see dns right here and it says running and then we can check out our logs and we can kind of see what it says there's not a lot here it really is just kind of doing its thing but you should see in your logs that it's got this user id and group id so then it tells you right here your ip was updated on this date and about i'm guessing when it updates it'll tell you this i don't know if it'll say this every five minutes when it goes off but i'm guessing when it updates it'll actually give you this information so that's it duck dns is running and i've got a way to get to my actual host information now here's what's going to happen i'm going to go to osia and i get exactly what i would expect because i run nginx proxy manager it gives me the congratulations page here at my home because i don't have anything that that points to i don't have anything that osia.dns.org actually points to but now i've got a way to get into it so i could go create all kinds of different duct dns subdomains get those tokens i can go put them in they're actually under my account i probably get the same token but multiple sub domains that i can run so let's just go create one that says i want to get to my mesh central so we're going to go back to the duck dns page here i'm going to try to create another one so let's just create um my mesh central and that's really long you should try to pick some that are short but it's kind of hard to do so mesh ctrl let's see if it'll let me have that one okay says it was added to my account so meshctrl.dns.org was added to my account cool so now i can go back and i can change this up all right so first let's uh let's let's go into my pertainer here and i did it from the cli you saw what i did all you do is just comma separate those things in the docker compose file so let's go stop this guy let's clear let's do docker compose down there we go i'm going to clear it out i'm going to exit like that so now docker compose should not be or dns should not be running here in the background so let's just refresh and it's gone so now we'll go do it from the app templates just so you can see how to do it that way as well so again we just go here i've already got it i've searched it so here it is right here now in this case i'm going to put in my subdomain so that's osia.duckdns.org and then comma meshctrl.dns.org and then here's my token so i still have it uh remembered there in my clipboard but if you don't just go back to your duck dns page and grab it put your token in i'm going to leave that the same and then i'm going to go here and just check to see i don't see any volumes that are set i could add the label right here if i want to for uh for the watchtower stuff so again you can add that label so watchtower doesn't mess with what you're trying to do but right here i've got everything set i'm just going to hit deploy and it says that it's deployed and it shows duck dns is running so we're going to go and check it out here and we'll just make sure it looks like it's running good we'll check the logs everything here looks like it's running properly it might take just a second to get that last little indicator that says hey we updated your stuff but it should be okay it may not need to update it so now i'm going to go test and make sure me this is just going to go to my congratulations page but mesh ctrl.dns.org yep that's what i expect so it does go there great now i can go into nginx proxy manager and i can actually set that up so 192.168.7.125 [Music] 81 there we go so here we go i'll log in so i'm just going to create a second host for that one so i'm just going to hit add host i'm going to call this uh there we go mesh central dot duck dns and that's going to be http and we're going to give that the ip address inside my network for where my mesh central runs so i've got that now i need to change this to https and i need to go to ssl tab i'm going to say request a new ssl certificate so that's going to get me one for the dns.org certificate and i'm going to say force ssl and i agree make sure my email address is there i'm going to hit save all right now i'm going to click on this thing and there we go so now i'm getting ssl encrypted traffic to my mesh central space and i'm doing that through duckdns.org which is awesome so now i've got an actual ip address so that as my ip at home changes i'm able to keep up with those changes i just go to this address and it should be able to keep up with those changes for the i p address i'm not worried about what my ip address is i'm not worried about going out and changing dns settings all the time it's really just gonna keep up with it for me as long as that duckdns.org look at that duck dns container is staying up and running my system should be available through that duck dns you are i want to open up some channels for discussion so i've created this rocket chat server and i've got it mixed up with jitsi mead i've created a few channels already to start up some discussions but of course we can always open up more channels if you'd like to jump in and send me a direct message or just ask a question in one of the channels i'll be monitoring the system it'll be up and running i'm going to leave this up and going so that we can have a place where we can all come together and answer each other's questions and have good discussions and good conversations it's disgust.opensourcesawesome.com again that's disgust.opensourcesawesome.com i'll have the links in the show notes and the description i hope you guys enjoyed this if you did like subscribe tell your friends about it so they can come along the journey with us and i'll talk to you next time you
Info
Channel: Awesome Open Source
Views: 33,157
Rating: undefined out of 5
Keywords: open, source, opensource, open-source, self, hosted, selfhosted, self-hosted, free, libre, software, server, web, internet, browser, linux, mac, macos, os x, windows, microsoft, unix, bsd, ios, android, pi, raspberry, desktop, digital, ocean, digitalocean, vps, tutorial, how to, setup, installation, instructions, cli, command line, terminal, interface, open source software, open source news, open source projects, duck dns, duckdns, dynamic dns, dynamic, dyndns, ddns, dynamic domain, duck domain
Id: Dm5MyuUdq2s
Channel Id: undefined
Length: 23min 51sec (1431 seconds)
Published: Tue Jun 08 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.