GT Explains: What is Dynamic DNS and How to Get It

In the article about how to use Microsoft remote desktop, we explained how to connect remotely to your PC. But for that to work, both PC’s were required to be on the same local network. What if you are far away from home, using another Wi-Fi or mobile data connection? In this scenario, you will require your PC’s external IP address to connect. Dynamic DNS is a service that gives your PC a link, like websites, so you don’t have to remember long numbers.

shutterstock_281469323c
Image via Shutterstock.

To learn more about DDNS and how to get one, read the explanation below.

What is DNS?

While we have already explained in the past about DNS and IP addresses, here’s a quick rundown. All the websites and devices connected to the internet have a unique address, known as an IP address, which is a string of numbers used to identify the connecting setup.

But who wants to type http://74.125.224.72/ to access Google? It’s much easier to type and remember google.com, right? The Domain Name System or DNS redirects you to the IP address of the website when you type its URL (google.com) in your browser.

DNS and DDNS

What is a Dynamic DNS?

This brings us to Dynamic DNS or DDNS. Just like websites, your PC (or router) is also a device connected to the internet, which has an IP address, assigned to it by your ISP. But this address keeps changing unless you have opted for a static IP. Dynamic DNS service gives your PC a host name, which always redirects to your PC’s IP address and also updates it automatically if it changes. Now you may ask, why do I need my PC’s IP address? For many reasons, such as to access it remotely, run an FTP server, run a static website, etc.

Cool Tip: If you can’t see extensions then go to Folder Options >View tab and uncheck Hide extensions for known file types.

How Do I Get DDNS Service?

To get DDNS service you will need to sign up with a provider. There are both paid as well as free services. A simple Google search will lead you to many free DDNS providers. Earlier, DynDNS was a popular service, but a while ago they shut down all the free plans. Its popular alternative, which I use and recommend, is No-IP.com. They provide 3 hostnames, which is enough for a regular user. To set up DDNS using No-IP follow these steps:

Step 1: Go to No-IP and sign up for a free account. After logging in, click on your username in the top left corner to open the My No-IP settings page. Then click on Add a Host.

Add_Host

Step 2: Enter the host name that you want the IP address to be associated with and leave the other settings as they are.

Host Details

Step 3: Now we need to set things up at your end. Based on your network configuration, the process will differ. DDNS can be set in the router itself if it supports the DDNS service or you can use No-IP’s application on your PC.

Setting Up in Your Router

Find the DDNS setting for your router by going to the manufacturer’s website. See if it supports No-IP (or any other free service you have chosen).

Router_DDNS_settings

If the DDNS service is supported, then enter your No-IP username, password, and domain name you set in Step 1 during signup. Click on Save or Login to finish.

Setting Up in Windows

Download No-IP’s application for Windows and install it. Open it and enter your username and password. That’s it, now whenever your public IP changes, the app will update the domain name automatically.

no-ip_checker

Your Own DIY DDNS (Sort of)

This method, which I use, requires no sign up with a third party provider or any application installation. It will update your public IP to a text file in Dropbox (or any other cloud service you use) and you have to just open the file to get your current IP address. So in cases when you just need an IP address of your PC and don’t care about the domain name, this method is useful.

Step 1: Create a text file in your Dropbox folder. You can name that file as per your wish. To make things clear I have named it ExternalIP. Save that file and make sure its extension is .txt. Create a folder, preferably in your C:\ drive, and inside that folder create another text file named myscript. Make sure that you name the text file of the script and folder in which it is stored, without any spaces.

Script_Path

Step 2: The main work here is done by a Powershell script. Don’t fear, you don’t have to learn Powershell or some programming language, the script is already made, you just have to copy it.

$OutputFile = ""
"" | Out-File $OutputFile
While ($True) {
$IP = $(Invoke-WebRequest "http://icanhazip.com" | Select -ExpandProperty Content).Trim()
If (((Get-Content $OutputFile)[0]) -ne $IP ) {
$IP | Out-File $OutputFile
"The IP for " + $env:COMPUTERNAME | Out-File $OutputFile -Append
Get-Date | Out-File $OutputFile -Append
}
}
Start-Sleep-Seconds 180

Copy the above script to the myscript text file you created in the previous step, and change the to the address of the ExternalIP text file you made previously in your Dropbox folder. Now save the myscript text file (the one with the above script, not the one in Dropbox folder) with a .ps1 extension.

Step 2: Now open Powershell (press Win key + S, search for Powershell), right click it, and select Run as Administrator. In the Powershell window, type the following:

Set-ExecutionPolicy RemoteSigned

It will ask again to confirm, type Y and then Enter. Then type the following and press Enter.

c:\\myscript.ps1

Running_Script

It may seem nothing has happened after pressing Enter, but don’t worry, the script has started running in background.

Step 4: Now whenever you need the IP address of your PC, just open the text file. The script also mentions the time of the IP address update.

Conclusion

I hope now you know more about DDNS. Still have questions or doubts? You can always clear them via the comments section.

Also See
#gtexplains#network

Join the newsletter

A geek, gamer, DIY enthusiast who loves to read about technology, computers and especially How-Things-Work!!