DDNS on a Raspberry Pi using the Cloudflare API (Dynamic DNS)
Вставка
- Опубліковано 2 чер 2024
- Protect yourself!! -www.privateinternetaccess.com... --
83% discount! That's less than 3 dollars a month, PLUS, you get 2 extra months for free!
🔎🔎Links and Guide: bit.ly/3hG55wI
DDNS or Dynamic DNS is REQUIRED if you don’t have a static Public IP address for your home network. In this video, I’ll show you how to setup DDNS on a Rasberry Pi (or any Linux computer) using a Linux Bash script and Cloudflare. We’ll also use crontab to make sure it keeps your IP address up-to-date!
Get a raspberry pi: geni.us/aBeqAL (affiliate)
🔥🔥Join the NetworkChuck membership: bit.ly/3riRhek
SUPPORT NETWORKCHUCK
---------------------------------------------------
➡️NetworkChuck membership: bit.ly/3riRhek
☕☕ COFFEE and MERCH: NetworkChuck.coffee
Check out my new channel, bit.ly/nc_clips
🆘🆘NEED HELP?? Join the Discord Server: / discord
STUDY WITH ME on Twitch: bit.ly/nc_twitch
READY TO LEARN??
---------------------------------------------------
-Learn Python: bit.ly/3rzZjzz
-Get your CCNA: bit.ly/nc-ccna
FOLLOW ME EVERYWHERE
---------------------------------------------------
Instagram: / networkchuck
Twitter: / networkchuck
Facebook: / networkchuck
Join the Discord server: bit.ly/nc-discord
0:00 ⏩ Intro
0:26 ⏩ What is Dynamic DNS??
1:42 ⏩ What do you need?
2:21 ⏩ STEP 1: Setup your Linux (bash) script
9:06 ⏩ STEP 2: Automate your script (crontab)
AFFILIATES & REFERRALS
---------------------------------------------------
(GEAR I USE...STUFF I RECOMMEND)
My network gear: geni.us/L6wyIUj
Amazon Affiliate Store: www.amazon.com/shop/networkchuck
Buy a Raspberry Pi: geni.us/aBeqAL
#ddns #raspberrypi #pia - Наука та технологія
Protect yourself!! --www.privateinternetaccess.com...
--- 83% discount! That's less than 3 dollars a month, PLUS, you get 2 extra months for free!
🔎🔎Links and Guide: bit.ly/3hG55wI
DDNS or Dynamic DNS is REQUIRED if you don’t have a static Public IP address for your home network. In this video, I’ll show you how to setup DDNS on a Rasberry Pi (or any Linux computer) using a Linux Bash script and Cloudflare. We’ll also use crontab to make sure it keeps your IP address up-to-date!
Get a raspberry pi: geni.us/aBeqAL (affiliate)
🔥🔥Join the NetworkChuck membership: bit.ly/3riRhek
SUPPORT NETWORKCHUCK
---------------------------------------------------
➡NetworkChuck membership: bit.ly/3riRhek
☕☕ COFFEE and MERCH: NetworkChuck.coffee
Check out my new channel, bit.ly/nc_clips
🆘🆘NEED HELP?? Join the Discord Server: discord.gg/networkchuck
STUDY WITH ME on Twitch: bit.ly/nc_twitch
READY TO LEARN??
---------------------------------------------------
-Learn Python: bit.ly/3rzZjzz
-Get your CCNA: bit.ly/nc-ccna
FOLLOW ME EVERYWHERE
---------------------------------------------------
Instagram: instagram.com/networkchuck/
Twitter: twitter.com/networkchuck
Facebook: facebook.com/NetworkChuck/
Join the Discord server: bit.ly/nc-discord
0:00 ⏩ Intro
0:26 ⏩ What is Dynamic DNS??
1:42 ⏩ What do you need?
2:21 ⏩ STEP 1: Setup your Linux (bash) script
9:06 ⏩ STEP 2: Automate your script (crontab)
AFFILIATES & REFERRALS
---------------------------------------------------
(GEAR I USE...STUFF I RECOMMEND)
My network gear: geni.us/L6wyIUj
Amazon Affiliate Store: www.amazon.com/shop/networkchuck
Buy a Raspberry Pi: geni.us/aBeqAL
#ddns #raspberrypi #pia
Let's gooooooooiii
Network Chuck can you do projects on the raspberry pi. Like how to connect sensors to it, how to program it. There isn’t enough clear videos out there on it.
WARNING!!
5:26 Zone ID and Account ID is visible .
Not sure why you are hiding your DNS records - it's not like we can't just go read the records since we have the domain name. lol
WARNING
Hey bro, your global key was shown at 5:27
ua-cam.com/video/rI-XxnyWFnM/v-deo.html
be quick and edit the video !!!!!!
hey everyone I just landed my first job in IT as a datacenter tech!
Congratulations! Got into help desk technician while I build my programming portfolio.
You have my sympathy and prayers.
Congrats 👏
Congrats broo
Ok
Hey Network Chuck!
K0P1 Here 👋 I was wondering why the script i wrote sometime ago suddenly gain some traction. Big thanks for the feature and great tutorial!
good work mate
Love the script and perfect for my use case. I just got it all up and running and was able to update my record but it is no longer proxied. I think maybe there is an update to the API and possibly need to add something to line 68 in the script where we set the IP via the API. Can you shed any light on this?
@@kwiatriot6190 Hi! At the moment I'm out serving the military. If possible, do submit a pull request for fix when you found the solution to the issue. Sorry for the inconvenience 😓
@@jasonkkf_ no problem at all, thank you for your service!!
@@jasonkkf_ I figured it out in the end it was just me not setting the proxy variable correctly. Be safe out there
Thanks Chuck! This is great. FYI for anyone doing this recently:
K0P1 has added a couple of config items to the script:
auth_method="" - it was necessary for me to set mine to "global" instead of "token"
proxy=false is the default so if your cloud flare DNS record is proxied, you need to set that to "true"
Otherwise, everything is just as Chuck showed in his video. :)
You just saved me thanks so much @James Cantwell I have been trying to work out why mine wasn't working
@@jamesgothard7881 Always good to help people from pulling out their hair. Cheers!
mine is not working. i did what you said and i keep getting ./cloudflare.sh: line 20: curl: command not found twice and then i get the date i hit enter and it sayes cloudflare: DDNS Updater: No public IP found.
Thanks.. it's working now. very helpfull
yip thanks man soon as I changed it worked.
This is very informative. Just a suggestion , the current cron job will keep updating the record every minute even if the ip address is not changing, modifing the shell script a little to put an if condition to check if current ip address is same as the IP a minute ago will help not to hit cloudflare API every minute .
The author of the script has updated it to do these checks now.
Good job. Please note the script now requires setting variable auth_method="global" for this to work as described in the video.
Thank you for your comment. I was breaking my head for like five minutes.
@@AgentP91 you actually saved the day
You ended two hours of failure and internet searching.
Lol, I just discovered the auth_method issue by trial and error!
I just found your channel and i love your teaching methods, I can actually understand what you saying and your videos are so enjoyable to look at :).
This is great Chuck! For example, DynDNS and Cloudflare services are great if you do IoT and want access to your devices at home or at a remote site for test and development purposes. Like you've shown with this configuration, you can point your IoT system at home or at a remote site to a URL and display all kinds of device and sensor data with the use of a Dynamic DNS service.
This channel has me gunning for an IT job by the end of the year, thank you for the inspiration
i've been on youtube since 2009, and this is the best tutorial i have ever seen by far, and i've seen all of them.
thank you so much for turning a topic i spent an hour or 2 being totally perplexed by into a thing i perfectly understand. this is the best ❤
Perfect and simple solution. I've seen loads of other people suggesting using ddclient instead, but THIS is a much better solution! thanks again Chuck!
I was looking for this guide!!! Love your videos 😀, helped me to learn a lot!
I found your videos and I enjoy. I just moved to another country and my goal is to work in the IT again. I have done it before but got behind with the latest developments. Really thank for this video since having a static IP is difficult to get.
man Im new at this but you are the best, your videos are so spot on and filled with small details like pointers and drawing on the screen thank you, loyal sub now.
You can have timeout in between. When script executes (depends how cron is setup) and also 5 min to apply changes. Also the other side can have issue with cache and this will not work if you are behind CGNAT which is popular this days since providers are out of ipv4 and they don't support ipv6. Thanks for the great video, just wanted to add some issues that someone can run into
I've been waiting for you to upload
AMAZING!!!! Love the Pi Cluster you got.
I’ve been using no-up and their DUC but this is much more elegant and I already use cloudflare. Thanks!
Love this lesson. If I ever forfeit my static IP from the ISP I will set up this little device for sure.
Outstanding video Chuck!
thank you so much for showing us this. i needed that so hard for my home lab
Dude! Awesome. This is an extremely valuable video for me. I use cloudflare but I've never taken time to use their dynamic DNS capability although that's exactly the reason I signed up. Now I can get this done in an hour watching your video so I'll go ahead and take advantage of that, thank you so much.
This.... is..... genius! I was exactly looking for something like this! Thanks Chuck!!
Yesterday at my organization I came across some situations where I came to know the concept of DDNS and see today I am getting your video about this.i think something will very Good happen upcoming days will be so good for me
Been looking for this video for a while now, thanks man
Hey Chuck, love your videos and I binge watch them all the time.
Question, could you add Closed Captions?
I watch vids on 2x or 3x speed so I like having them on
did this like 2 years ago I really wish I had had your video!
great job again
You got to be the first person within IT I've ever heard admit that nano is your favorite editor 😂 I've felt so alone for so long!
nano is one of my fav's, kinda hate vim tbh... tried it/was forced to for class and hated every second of it.
@@mileso7424 yeah I had to try vim, obviously. It looks efficient when people know how to use it, but I always comes back to nano
There's a HomeAssistant integration for Cloudflare that I use to do this. Works wonders!
Super video I was waiting for the video Chuck And your videos are awesome And informative I like your videos
Great videos chuck! Would like to see a video implementing this scrip directly on synology instead Pi.
Awesome. I suggested this topic on another video. Thanks for listening.
Great video, very informative. I have learned a lot from all of your videos.
Is it just me or does anyone else just want more and more raspberry Pi videos
Great tutorial as usual @NetworkChuck. I think it might be worth to mention that there's one last step in order to access the Raspberry PI from the internet, port forwarding needs to be setup on the router the PI is connected to
Awesome stuff, yeah honestly helps with a big barrier to self-hosted stuff!
these home lab videos are dope
Love your video. I am setting it up now.
I was looking for this video thankyou thank you very much
Thanks dude, that is exactly what I needed. 👊
Great explanation buddy 👍
Love yourr video chuck from Malaysia🇲🇾
so much for dyndns. thanks for sharing mate, this is a great video. for any of those who don't use a PI if you use another linux box and you get an error on line 15 ; apt install curl :)
"line 21: curl: command not found" also with line 24. Now it works, thanks for that!
Thank you for sharing this, lifesaver, running it in a VM in my case
Cool! Thanks for this video!! i do use your setup with cloudflare and Kemp Load Balancer.. workst very great!! and this is what i need too.. i have Dynamic Ip here.. and sometime it change yes! drama when that happen lol!!! Great Job..
While i watch you i became addicted to coffee ☕🤣 I wish you all the best
This dude is giving out the best free information
awesome tutorial. Thanks man!
Always golden content. Chapeau 🧢
I like this video. thanks Chuck!
Chuck, You're The Man. Thank you.
You helped me a lot, thank you so much^^
Thank you for mentioning the problem with Freenom Domains at the beginning of the video. I was pully my hair out trying to figure what was wrong.
I was using the Docker version `oznu/cloudflare-ddns:latest` which hasn't been updated in 2 years, but everywhere I found, some just 3 months ago, they were using it. Never was a problem with Freemon mentioned so I thought the problem was somewhere else. It's a bummer it doesn't work, but knowing means I can stop trying to get it to
this channel is the shit! thank you, NetworkChuck! you're the best!
Hey Chuck, I just wanted to say thanks for all time that you have put into your network videos! I have learned a ton from you! That being said I don’t know anyone other than you that could possibly answer my question. I know you’re a lucky man. Lol. What I’m looking for is a device or pi that has some type of software or vpn settings that I can plug into an internet connection and report back home so I can access the devices that are plugged it’s network I can access remotely. I would need to have several out in the field. I have heard of a Cloud Bridge service that uses a something similar to a pi but I can’t seem to find and details about it. Thanks for any input.
was scared to death to do this but i did it. Broke some stuff but i fixed it also. Thanks Chuck!
Worked like a charm for me on arch linux 👍
Nice to see that the freenom free tlds limitation with cloudflare has been addressed here.
Thank you! Works perfect!
Oh yes, thanks for the tips ! The api + script was the missing part in my setup.
I do sudo -i to be God mode
I will do the job with VIM, I like things clean
Thanks, nice tutorial!
It is 2 am here.... But this is more important then my sleep..... Love your content Chuck...
Hack your sleep
Great video sir!
Love your video chuck, can you make more videos on networking with python
There's a Channel called IPv0 ...
It has a great network automation using python playlist . Check it out
@@user-gk9oh2fp2u its not like I don't know anything about networking with python, ive been using Python for 2 years now and I just wanted to get little tips and tricks on network automation and stuff like that on a daily basis
@Just Some Random Channel yeah Python is simple yet its the most powerful one out there
@Just Some Random Channel python is a REAL THING man!
ATTENTION: Git has updated and for your video the variable auth_method has to be change to "global" if you want it to work with the Global API Key. Cheers Chuck. thnks
life savior
There goes my hero!
thanks
Great video’s i love it thanks a lots 🤞
I wrote a version that runs as a Cloudflare Worker. The idea is you POST an api token & the id of the hostname you want to update to the worker - Cloudflare adds a header containing your public IP address which the worker can then use to update the DNS record specified. This makes the client side incredibly simple and can be entered as a single command line directly into your Crontab. AS it can use the free tier of CF workers it costs nothing to run.
Hey Tim, awesome idea! Could you share the code of your worker please?
Love this guy! Sudo Coffee and nano ☕ 👏
i like these videos, so entertaining lol
My dyn "lifetime" account expires next year, just got this set up so I won't have to worry about it, thanks for this
man i really want a rasberry pi 4! im a begginner to linux and only know python and a little front end deveolpment of websites, it would be nice to get better at linux! thnx for the vid, ur probably one of my favourite tech/programming youtubers, among linus, your a god!
Thanks for the information
God i like watching every video on your channel Long time fan!
you make all this coding shit less scary, and it inspires me to follow along and learn
Thanks been fighting acme under pfsense, for my freenom domains, I see the light!
Full support to you sir
Great tutorial, currently you need to create specific DNS token (read /write) to make it work.
Not sure if you meant to but, love the Loki reference! "Not sure if am a robot?"
ua-cam.com/video/skGbcOSj5D0/v-deo.html
Thats great ...😀 please make a video about nic bonding
Gonna get coffee and watch the vid ☕
Keep it up brother
that is what I need, thank you
Thank you! My brain hurts now but it worked!
Last night I was actually installing and testing a VPN through a NoIP DDNS and a RPi, now this I gotta try too.
Lifesaver chuck.
Update: while editing the script change auth_method to global from token.
THANKYOU!!!
nano is def the best! Great video as usual, thanks again.
vim is better, nano is a mess
about the get one part 0:39 in US a dell poweredge cost about 150$ here in Cambodia the same spec cost about 600$
Cool I learned something new 😁
I’ve been waiting for this video on UA-cam, I wanted to do it ty Chuck!
I remember running servers at home over dial-up and DSL circuits with dynamic IP's. I wrote a program that would alert me to a change in external IP. Unfortunately, I'd then have to manually change public DNS records. I guess I would have had something unique at the time if I had figured out a way to automate that process ;)
It's already been said in some previous comments, but */1 is useless, you could just write *.
* means "every" minute/hour/etc while */N notation means "every N" minute/hour/etc
Another thing: restarting cron is also useless since using "crontab -e" automatically installs the new crontab.
Thanks! Your awesome!
@NetworkChuck You should do video on a more secure version of this using cloudflared to bypass having to open up ports on your network.
Cool video m8! I thought No-IP it was the only way to have DDNS on a home Linux machine like RPi, Thanks!
Great tutorial Chuck, I think showing how to setup all in one PiHole/DDNS/VPN on Raspberry Pi 4 B would be very valuable. Thanks.
tbh I love no-ip. It has it own DDNS programm for linux/windows/mac and you can get a subdomain aswell. Love it.
Love the outro
I did it, I got a heart from network chuck
hahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhahhahahhahhahahhahahahhahahahhahahahhahahahahahhahahahhahahhhahahhahahahahhahahahhahahahahhahahahhahahahahahhah
I did it
Thanks man! Hosting a couple minecraft servers this was getting frustrating for me
Let me begin with a big hearty thanks for these videos! Your enthusiasm certainly makes these stand out way above all others!! Great Job...
Your instructions are very clear to follow and I can confirm that this DDNS solution definitely works! However, I did notice one anomaly which I'm hoping you might help me understand. It seems that when testing the script execution, not only does it change the IP address back to my Public IP, it also changes the Proxy status from "Proxied" back to "DNS Only". Anyone else encounter this??
hi if you havent seen it yet, James Cantwell posted that the config has been updated, change proxy to true in your script and proxy will stay enabled in cloudflare..