Difference between revisions of "Dynamic DNS"

From ArchWiki
Jump to: navigation, search
m (Starting ddclient after networking is up: add missing ordering after network-online.target)
(Undo revision 539635 by ZombB (talk) sorry, freeDNS was allready mentioned above)
(18 intermediate revisions by 12 users not shown)
Line 27: Line 27:
 
|-
 
|-
 
! [http://now-dns.com/ Now-DNS]
 
! [http://now-dns.com/ Now-DNS]
| Free || A, AAAA || unlimited || Use protocol {{ic|dyndns2}}, server {{ic|now-dns.com/update}} ||  
+
| Free || A, AAAA || unlimited || [https://now-dns.com/client/ddclient.conf example] ||  
 
|-
 
|-
 
! [http://www.changeip.com/ ChangeIP]
 
! [http://www.changeip.com/ ChangeIP]
| Free or paid || A, AAAA, CNAME, MX, codomains || 7 free || ||  
+
| Free or paid || A, AAAA, CNAME, MX, codomains || 7 free || [https://sourceforge.net/p/ddclient/wiki/protocols/#changeip example] ||  
 
|-
 
|-
 
! [http://www.dnsdynamic.org/ DNSdynamic]
 
! [http://www.dnsdynamic.org/ DNSdynamic]
Line 36: Line 36:
 
|-
 
|-
 
! [https://www.duckdns.org/ Duck DNS]
 
! [https://www.duckdns.org/ Duck DNS]
| Free and open source || || || || {{aur|duckdns}}
+
| Free || || || [https://sourceforge.net/p/ddclient/wiki/protocols/#duckdns example] || {{aur|duckdns}}
 
|-
 
|-
 
! [http://freedns.afraid.org/ FreeDNS]
 
! [http://freedns.afraid.org/ FreeDNS]
Line 42: Line 42:
 
|-
 
|-
 
! [http://www.noip.com/ No-IP]
 
! [http://www.noip.com/ No-IP]
| Free or paid || || 3 free, 25+ paid || Use protocol {{ic|dyndns2}}, server {{ic|dynupdate.no-ip.com}} || {{aur|noip}}
+
| Free or paid || || 3 free, 25+ paid || Use protocol {{ic|noip}}, server {{ic|dynupdate.no-ip.com}} || {{aur|noip}}
 
|-
 
|-
 
! [https://www.nsupdate.info/ nsupdate.info]
 
! [https://www.nsupdate.info/ nsupdate.info]
 
| Free and open source || A, AAAA || || Use protocol {{ic|dyndns2}} || {{aur|inadyn-fork}}
 
| Free and open source || A, AAAA || || Use protocol {{ic|dyndns2}} || {{aur|inadyn-fork}}
 +
|-
 +
! [https://dyn.com/dns/ Dyn DNS]
 +
| Free or paid || A, CNAME, MX ||  || [https://sourceforge.net/p/ddclient/wiki/protocols/#dyndns2 example] || {{aur|ndyndns}}
 +
|-
 +
! [https://www.namecheap.com/ Namecheap]
 +
| Paid || A, CNAME || || [https://sourceforge.net/p/ddclient/wiki/protocols/#namecheap example] || {{aur|ndyndns}}
 +
|-
 +
|-
 +
! [https://www.dynu.com/ Dynu]
 +
| Free or paid || || 4 free, 500 paid || [https://www.dynu.com/DynamicDNS/IPUpdateClient/DDClient example] ||
 
|-
 
|-
 
|}
 
|}
 +
{{Note| Free users of no-ip are required to manually confirm their domain(s) every 30 days. Domain confirmation is not required for Enhanced users though. More info at [http://www.noip.com/support/knowledgebase/why-is-my-hostname-pending-deletion/ Why is My Hostname Pending Deletion?]}}
 +
 +
==== Use an external website to determine IP address  ====
 +
 +
If ddclient is unable to detect your IP address, you can configure ddclient to fetch your IP from an external webpage such as [http://whatismyip.org/ whatismyip.org]. Add somewhere in the config file:
 +
 +
{{hc|/etc/ddclient/ddclient.conf|2=
 +
# use whatismyip.org to determine IP address
 +
use=web
 +
web=whatismyip.org
 +
}}
  
 
==== Starting ddclient after networking is up ====
 
==== Starting ddclient after networking is up ====
  
If you find that ddclient is unable to update your IP properly, it may be that the ddclient process is starting before networking is up. To fix it, you can edit the unit file to depend on {{ic|network-online.target}} (added lines in bold):
+
If you find that ddclient is unable to update your IP properly, it may be that the ddclient process is starting before networking is up. To fix it, you can edit the unit file to depend on {{ic|network-online.target}}:
  
{{hc|# systemctl edit --full ddclient.service|2=
+
{{hc|# systemctl edit ddclient.service|2=
 
[Unit]
 
[Unit]
Description=Dynamic DNS Update Client
+
After=network-online.target
After=network.target
+
Wants=network-online.target
'''After=network-online.target'''
 
'''PartOf=network-online.target'''
 
 
 
[Service]
 
Type=forking
 
PIDFile=/var/run/ddclient.pid
 
ExecStart=/usr/bin/ddclient
 
 
 
[Install]
 
'''WantedBy=network-online.target'''
 
 
}}
 
}}
  
{{Note|
+
Additional configuration for {{ic|network-online.target}} may be necessary, see [https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget#cutthecraphowdoimakenetwork.targetworkforme].
* A full replacement must be created, because a drop-in override cannot modify the {{ic|[Install]}} section of a unit file. Make sure to disable and reenable the {{ic|ddclient.service}} so that the symlink is put into the right place.
 
* It may be necessary to configure the network manager to activate {{ic|network-online.target}} (for [[netctl]] see [[netctl#Activate network-online.target]]).
 
}}
 
  
 
=== Other tools ===
 
=== Other tools ===
Line 83: Line 91:
  
 
=== duiadns ===  
 
=== duiadns ===  
[https://www.duiadns.net Duiadns.org] is a free service which can be automated with {{AUR|duiadns}}{{Broken package link|{{aur-mirror|duiadns}}}}.
+
[https://www.duiadns.net Duiadns.org] is a free service.
  
 
=== FreeDns.io ===
 
=== FreeDns.io ===
Line 95: Line 103:
  
 
[http://system-ns.com/ System-NS] is a free service which can be updated via the command line. See [https://system-ns.com/services/dynamic the official documentation].
 
[http://system-ns.com/ System-NS] is a free service which can be updated via the command line. See [https://system-ns.com/services/dynamic the official documentation].
 +
 +
===  Loopia.se ===
 +
 +
If you use loopia.se as name server, you can query updates of DNS records via ''curl'' as described in the [https://support.loopia.se/wiki/curl/ official documentation].
 +
 +
If you use 2FA for login, or by some other reason would rather use the LoopiaAPI via a python script to change the DNS dynamically, you should follow the instructions [https://support.loopia.se/wiki/uppdatera-dynamisk-ip-adress-med-loopiaapi/ on this page]. The python file is well written and easy to understand, and basically all you need to do is to generate an API key on your login at Loopia kundzon first.

Revision as of 17:13, 4 September 2018

Dynamic DNS or DDNS is a method of updating, in real time, a DNS to point to a changing IP address on the Internet. This is used to provide a persistent domain name for a resource lacking a static IP. To use DDNS, you need to both sign up with a DDNS provider and set up an automatic update tool that will notify the provider when your IP address changes.

Update tools

Router

If the device needing DDNS sits behind a router, you should first check if the router itself can update any DDNS services. Although the selection of services may be limited, there are several advantages to using the router: it will probably be easier to set up, will require little to no maintenance, and will have no downtime (if the router is down you won't have Internet anyway).

ddclient

ddclient is compatible with many DDNS services and is the recommended tool for updating DDNS if your router is not an option. It includes systemd support.

After installing, edit the default config /etc/ddclient/ddclient.conf to set up your DDNS provider (it includes many examples). Then enable and start ddclient.service.

Some of the compatible services are listed below, but you can also check the examples and protocols for more.

ddclient compatible services
Service Cost Available Records Hostname Limit Config Notes Alternative tools
Now-DNS Free A, AAAA unlimited example
ChangeIP Free or paid A, AAAA, CNAME, MX, codomains 7 free example
DNSdynamic Free example
Duck DNS Free example duckdnsAUR
FreeDNS Free or paid CNAME, A, AAAA, MX, NS, TXT, LOC, RP, HINFO, SRV 5 free example afraid-dyndns-uvAUR, petrifiedAUR
No-IP Free or paid 3 free, 25+ paid Use protocol noip, server dynupdate.no-ip.com noipAUR
nsupdate.info Free and open source A, AAAA Use protocol dyndns2 inadyn-forkAUR
Dyn DNS Free or paid A, CNAME, MX example ndyndnsAUR
Namecheap Paid A, CNAME example ndyndnsAUR
Dynu Free or paid 4 free, 500 paid example
Note: Free users of no-ip are required to manually confirm their domain(s) every 30 days. Domain confirmation is not required for Enhanced users though. More info at Why is My Hostname Pending Deletion?

Use an external website to determine IP address

If ddclient is unable to detect your IP address, you can configure ddclient to fetch your IP from an external webpage such as whatismyip.org. Add somewhere in the config file:

/etc/ddclient/ddclient.conf
# use whatismyip.org to determine IP address
use=web
web=whatismyip.org

Starting ddclient after networking is up

If you find that ddclient is unable to update your IP properly, it may be that the ddclient process is starting before networking is up. To fix it, you can edit the unit file to depend on network-online.target:

# systemctl edit ddclient.service
[Unit]
After=network-online.target
Wants=network-online.target

Additional configuration for network-online.target may be necessary, see [1].

Other tools

Other DDNS updaters that work with several providers are inadyn-mtAUR (supported providers) and ndyndnsAUR (supports DynDNS and Namecheap).

Other providers

The following DDNS providers are not compatible with ddclient so updating your IP with them may require a special tool or some custom scripting. Remember that if the service allows you to update your IP using the command line, you can automate the process using tools such as cron or systemd/Timers.

duiadns

Duiadns.org is a free service.

FreeDns.io

FreeDns.io provides free A and AAAA DNS records and CNAME, TXT and MX records with a premium membership. You can update your IP using their HTTP API (with a 60 requests-per-hour limit). They provide several example scripts.

Now-DNS

Now-DNS.com is a free service which is easy and uncomplicated to set up.

System-NS

System-NS is a free service which can be updated via the command line. See the official documentation.

Loopia.se

If you use loopia.se as name server, you can query updates of DNS records via curl as described in the official documentation.

If you use 2FA for login, or by some other reason would rather use the LoopiaAPI via a python script to change the DNS dynamically, you should follow the instructions on this page. The python file is well written and easy to understand, and basically all you need to do is to generate an API key on your login at Loopia kundzon first.