Tracking your Dynamic ISP IP Address for use with your Home Server with Cloudflare DDNS & Duck DNS

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi there and welcome to another video now in this video we're going to be looking at static ip addresses dynamic ip addresses and how we can track the dynamic ip address that's issued by our isp and use that with our home servers and to do that we're going to be setting up both duck dns and cloudflare dynamic dns and seeing what makes each one different sounds interesting then let's get started hi there guys so this is another video in the beginner core topic series where we're going to see how we can track our isp's dynamic ip address so we can use it to access our home server so just what is a dynamic ip address then well we get two types of ip addresses we get a static ip address which like the word says it's static which means it never changes it's always the same and we get what's called a dynamic ip address and the word dynamic meaning it can change it's dynamic and can be different things and we'll find both static and dynamic ip addresses in our local network inside our house in our lan our local area network and also out on the internet in the wide area network or wan so let's talk about static and dynamic ip addresses in our own network in our lan so on our local network the thing that gives out ip addresses is called a dhcp server and for most of us our router does this having a dhcp server built into it so let's take a laptop on our local network this is given its ip address from the router through the dhcp server and in this case over wi-fi this ip address is dynamic and it's been given to the laptop from a pool of different iop addresses that are still available on the router and the ip address which has been given by the dhcp server is given only for a certain amount of time with what's called a lease and generally this is about 24 hours but it can be much much longer or it can be much shorter just a matter of hours so the ip address the laptop's got the 192.168.0.101 if when the lease expires the laptop switched off or not on the network you can't ask for that same lease again so then that specific ip address will go back in the pool and then it can be given out to another device on the network such as a phone or something so when the laptop switched back on because its original ip address isn't available anymore when it asks for a new ip it will be given a different one so that's why dynamic ip addresses change because they're shared between multiple different things but a static ip is different a static ip address never changes at all and anyone who's watching this video who's got an unraid server no doubt you'll have set a static ip address for that because we need that to always be the same for example if we want to go to unraised web ui we always want it to be the same address but in fact for even people who don't have an unraid server and have never set a static ip address on their network everyone does have a static ip address your router that will be a static ip but your modem router when it's connected to the internet will have more than one ip address so let's turn this route around and have a look at the back so the static ip address of the router is on the local network side on the lan side here but it also has an ip address on the internet side or the wan side as well and that ip address is given to the router by the isp and again this can be a static ip address or a dynamic ip address but unlike setting ip addresses on our own network we can't actually set the ip address on the wan side to be a static ip address ourself we have to ask our isp to do that for us and normally when we have a static ip we pay a little bit more for our internet normally around an extra 10 a month so for most of us on our home connections we have a dynamic ip that's assigned to us by the isp just in the same way really that our router signs ip addresses to things on our local network again the dynamic ip from the isp will have a lease which will expire and when that lease expires then probably we're going to get a different wan ip address than we had before for the average internet user this just isn't a problem most people never want to actually connect back to their own network but for most people who are running a home server this is definitely something that we want to be able to do so for those of us then who have a dynamic isp wan address we need to better track it when it changes so we can connect back and we track it with the dynamic dns service such as duck dns or cloudflare's dynamic dns service and what this does is it links our wan ip to the host name and so whenever our one ip changes just like you can see in the diagram here that host name always points to the current ip okay so now we've established why we need a dynamic dns service let's go ahead and set one up and in this video we're going to be looking at setting up two different ones we're going to be looking at setting up duck dns and also the cloudflare dns service so why am i showing how to set up two different ones and just what is the difference between the two well the good thing about both of them is they're both a free service with duck dns you don't need to have your own domain when you set up duck dns they'll give you a free sub domain something like maybe myserver.dns.org with the cloudflare service you do need to own your own domain name and that domain name must be running through the cloudflare service so if you don't have your own domain name or that domain name isn't running through the cloudflare service then you're going to need to use duckdns however if you've got your own domain name and it's going through the cloudflare service then it makes sense to use cloudflare's own dyn dns okay so let's first set up duckdns so let's open a browser and do a search for duckdns then click through to the website dns.org and once on the duck dns website we don't actually have to sign up for a new account but what we do we can sign in with these various methods here actually the reddit method is not actually available anymore so probably when you look at this video in the future that option won't even be there so i'm going to log in with google okay so now i'm logged in now we need to create a subdomain with duckdns and we can choose whatever we want unless it's being used by someone else okay so i'm going to try space server okay so that one's taken so let's try again how about space invader server then ah come on someone's got that one as well okay let's try space unraid okay so i managed to get that one and we can see here it's already updated the ip address that i'm on now but obviously what we need to do is to have this ip address automatically update so let's go back across to the unraid server and set up a container that will do just that and let's head across to the apps tab here and search for duck dns and let's click on the button here to download it okay so here we have the template it's really simple so the first thing we need to do is put in our sub domain that we just created so i'm going to go back to dns and because i'm lazy i'm going to copy and paste it okay and so there's my sub domain pasted in so back over to duck dns again now this time we're going to copy in this token and then go back over to the docker template and paste the token in here so now this bit of software basically it will always check our ip address and update it to whatever it is so let's go down to the bottom we'll leave container start after install checked and click on to apply okay and it won't take long to pull down this container it's pretty small and let's click onto done okay so now if we go back to the docker tab here just to check everything's fine let's click onto it and go to logs and that's great we've got no errors at the bottom it says starting services and done we're all good okay so now let's actually check our sub domain is actually working and we're getting the correct ip so to do that let's open a search engine and do a search for what is my ip and then go to what is myip.com okay and so here's my ip address here so now on my computer i'm going to open up a terminal window and i'm going to check what the ip address of my sub domain is and so to do that i'm going to type ping and then my sub domain now this works with windows mac or linux the ping command and then just press enter and then it should see a reply with the ip address which is related to the sub domain and you can see here this is correct 70 39 126 38. okay so that's duck dns all set up and configured now whenever we use that sub domain it will always point back to the wan ip back on our home network so we can use that to connect to the server but we're not going to cover that in this video this video is just about setting it up and now moving on how to set up cloudflare and dns as well now to set this up we must already have a domain name and that domain name must be linked to a cloudflare account now if you don't know how to do that then please see my earlier video another beginner core topic video on how to buy a domain name and link it to cloudflare so once you've got a domain and it's all set up with cloudflare just head across to the cloudfare website and log in so let's sign in to cloudflare okay so now logged in we need to click at the top here and then go to my profile then here we want to go to api tokens okay so to be more secure we need to create our own token so we're going to click onto this button here and if we scroll right down we want to come here where it says create custom token click on to get started and we need to give the token a name so i'm going to call it cloudflare.dns so next we want to come down to where it says permissions here and we want to change where it says account from the drop down to zone and then under this drop down here we want to scroll down to zone settings and in this third section here we want to select read okay so then click add more and again we want to select zone and this time instead of zone settings we're going to choose zone and again we want to select read here and finally we're going to add one more again zone but this time dns and we want the dns permissions to be edit and then going down here to zone resources you want to leave that on to include and i'm going to change this from all zones down to all zones from an account and lastly select my account here okay so i'm going to scroll down and click on to continue and now just click on to create token okay so here's our token here so we're going to click on to copy and that will copy onto the clipboard okay so now we want to go back across to the android server and go across to the apps tab and type in cloudflare ddns and i'm going to choose this container here um self-hosted on ray discord repository and click on the little button to download okay so now let's fill in this template now the first thing to do here now because we've created our own zone api we don't need to have the email variable here so we're going to remove this and then where it says api key here we're going to paste in what we just copied to the clipboard and then for the domain you want to put in your domain and for me that's yourdomain.one now here it says optional but i really highly recommend using a subdomain and i'll show you why in a minute and i'm going to name my sub domain dynamic and everything else in the template we can just leave as it is cloudflare proxy true and ipv6 ipv4 records just set to a so let's scroll down to the bottom and click on to apply and it won't take a moment to pull down the container because it's very small okay so then click onto done okay so now let's go back to the docker tab here and we can see that the container started so we will check everything's fine so let's click on to it and go to logs okay so there's no errors in the log so everything's working fine so now let's go back to the cloudflare web ui and have a look at everything there and here's my domain here yourdomain.one and if i click on dns here and scroll down and there's the subdomain dynamic which has been created by the container and we can see here it's updated the ip address correctly now going back to the reason why i always prefer to use a sub domain rather than just having it update the main domain is basically because if you're using this domain for something else and you're running a website or something you might not want to have it update the kind of main actual root of the domain and if you wanted to have any other sub domains with the same ip all you'd have to do is to create a cname pointing back to this subdomain and so that way you can create multiple sub domains coming off the one you created in the container okay so before we wrap this up let's have a look at one other thing if we move this up to the top here so we can still see this part and open up a terminal window if i ping this domain here then you can see here that this ip address is not the same as here now that's perfectly normal because at the moment this sub domain is proxied so the ip address we're getting back here is cloudflare's ip address and my own ip address here is being hidden now if i clicked onto edit here and i turned the proxy off and clicked onto save and went back to the terminal window and reping that address again but before i do that i should really clear the dns on the actual computer so i'm going to run this command here and so now when i ping the same address i can now see my own one address and not the proxy cloudflare address when you're accessing services back on your network some services work fine when they're proxied but occasionally you'll get one which doesn't really like it that's all things we can worry about in another video because this video is just basically setting it up and nothing more and it'll be in the future videos where we'll be looking at how to set up this using a reverse proxy and accessing various containers on our server so anyway that's a good time to wrap everything up and bring this video to a close and so if you like this video then please hit that like button and if you're not a subscriber then please subscribe to the channel as always a huge thanks to all of my patrons and supporters out there thank you so much guys for enabling me to make these videos i really really do appreciate your support anyway guys it's getting late here now and it's time for me to go but whatever you're up to for the rest of the day i hope it's good and i'll catch you in the next video
Info
Channel: Spaceinvader One
Views: 52,983
Rating: undefined out of 5
Keywords: unraid, home server, spaceinvader one, dynamic dns, duckdns, duckdns unraid, duckdns docker, duckdns port forwarding, cloudflare dns, cloudflare dynamic dns, cloudflare dynamic dns unraid, spaceinvaderone, unraid tutorial, unraid os, unraid guide, unraid for beginners, how to install unraid, docker, beginners guide to unraid, unraid beginners guide 2021 edition, unraid help, unraid 6.9, unraid 6.9.1, unraid 6.9.2, unraid 6.9.3
Id: CS72kN2c6hU
Channel Id: undefined
Length: 14min 47sec (887 seconds)
Published: Wed Mar 17 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.