Tritonio

Setup Dynamic DNS / DynDNS for *FREE* on Raspberry Pi / Ubuntu

Mar 15th, 2021
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. You might have recently setup your Raspberry Pi or your Linux box as a 24 x 7 torrent downloader, or a small Web server to host your own website. And just then you realize that your ADSL or Cable Internet connection has a dynamic IP address which changes frequently and every time you reconnect. Thus, it becomes hard to access your box with a fixed Domain name or IP address.
  2.  
  3. To solve this problem you can setup a Dynamic DNS which will update your IP to a DNS name everytime it changes and you can access you hosted website, or ssh into it to monitor torrent downloads with ease.
  4.  
  5. While there are many paid dynamic dns service providers available, but here you will see one way to do it for **FREE** [Thanks to freedns.afraid.org]
  6.  
  7. Step 1
  8. Register for a Free domain at http://freedns.afraid.org/signup/
  9. [We will take techhome.homenet.org in this guide]
  10.  
  11. Step 2
  12. Logon to FreeDNS (where you just registered) and goto http://freedns.afraid.org/dynamic/
  13. Or, simply click on "Dynamic DNS" link from the left navigation menu
  14.  
  15. Right click on "Direct URL" and copy the URL and paste it somewhere.
  16.  
  17. You should notice a large and unique alpha-numeric key in the URL, make a note of it as shown below:
  18. http://freedns.afraid.org/dynamic/update.php?[alpha-numeric-key]
  19.  
  20. Step 3
  21. Install inadyn using the following command:
  22. sudo apt-get install inadyn
  23.  
  24.  
  25. Step4
  26. Configure inadyn using the below steps:
  27. sudo nano /etc/inadyn.conf
  28.  
  29. And add the following contains in it replacing the actual values:
  30.  
  31. --username techhome
  32. --password mypassword
  33. --update_period 3600
  34. --forced_update_period 14400
  35. --alias techhome.homenet.org,alphanumeric key
  36. --background
  37. --dyndns_system default@freedns.afraid.org
  38. --syslog
  39.  
  40.  
  41.  
  42.  
  43. Step 4
  44. Now, we need to ensure that the DNS updater (Inadyn) runs automatically after every re-boot
  45.  
  46. export EDITOR=gedit && sudo crontab -e
  47.  
  48. Add the following line:
  49. @reboot /usr/sbin/inadyn
  50.  
  51.  
  52. Step 5
  53. Reboot system and then run the following command to ensure inadyn is running:
  54.  
  55. ps -A | grep inadyn
  56.  
  57. Now your host is ready and up for accessing from internet...
  58.  
  59. You can trying ssh-ing from another computer over the internet
  60. ssh username@techhome.homenet.org
  61.  
  62. Or, if any web server is running, then simply browse to http://techhome.homenet.org
  63.  
  64. Or, you can just ping it to test ping techhome.homenet.org
  65.  
  66. To check the logs you can use this:
  67. more /var/log/messages |grep INADYN
  68.  
  69. This has been re-tested to be working perfectly with inadyn 1.96.2-1 on Raspbian 3.12.22+
Add Comment
Please, Sign In to add comment