Difference between revisions of "Dynamic DNS"

From ArchWiki
Jump to: navigation, search
m (Software: typo fixed)
(ddclient)
(13 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 
[[Category:Domain Name System]]
 
[[Category:Domain Name System]]
 
{{Article summary start|Summary}}
 
{{Article summary start|Summary}}
{{Article summary text|Setting up Dynamic DNS for Homeservers}}
+
{{Article summary text|Updating Dynamic DNS}}
 
{{Article summary end}}
 
{{Article summary end}}
  
'''DDNS, Dynamic DNS or DynDNS''' is a service which offers operators of homeservers the possibility to have an URL which does not change when the provider changes the servers public IP-Address.
+
'''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 that may change location on the network.
  
==Router or Server?==
+
==Router==
Most (home) routers offer connecting to different DDNS Services. But the offered lists are limited to serveal services which are most likely not free. If the Router supports a free service, or you are willing to pay or donate for a service, you should do this, it is faster and more reliable.
+
Many routers have built in DDNS Services but can be limited in the services which they update. If the Router supports a the service, or you are willing to pay or donate for a service, you should do this, it is faster and more reliable.
 
In that case, there is no need to use a softwareside solution.
 
In that case, there is no need to use a softwareside solution.
  
{{Warning|You should definetly set up NAT on your router or a firewall on your PC and do everything to secure your network and computers.}}
+
==Software Dynamic DNS==
 +
=== Afraid ===
 +
[http://FreeDNS.afraid.org FreeDNS.afraid.org] is a free Service which is easy and uncomplicated to set up.  
  
==Setting up DDNS==
+
There are several options to enable automatic DDNS updating for this provider:
===Service===
+
[http://FreeDNS.afraid.org FreeDNS.afraid.org] is a free Service which is easy and uncomplicated to set up.<br>
+
  
===Software===
+
==== afraid-dyndns ====  
After signing up there, install {{AUR|afraid-dyndns-uv}}, available in the [[Arch User Repository]]. It updates the IP.
+
The package {{AUR|afraid-dyndns-uv}} is available in the [[AUR]].
{{Note|Besides {{Pkg|perl}}, it depends on {{Pkg|perl-libwww}} and {{Pkg|perl-xml-simple}} available in the [[Official Repositories]].}}
+
  
Because whatismyip.com seems to block perl SWP requests, replace the line
+
==== ddclient ====
{{bc|1=$extip = get("http://automation.whatismyip.com/n09230945.asp"); # Fetch current IP from whatismyip}}
+
by
+
{{bc|1=$extip = get("http://api.externalip.net/ip/"); # Fetch current IP from externalip.net}}
+
in {{ic|/usr/bin/afraid-dyndns-uv}}.
+
  
===Configuration===
+
The package {{Pkg|ddclient}} is available in the [[community]] repository. It includes [[systemd]] support. Unfortunately, it seems to generate broken update URLs for freedns: http://ddclient.tisnix.be/ticket/58
After building and installing the package, configuration of {{ic|/usr/bin/afraid-dyndns-uv}} (which is a perl script) is necessary.
+
  
Locate the Lines
+
An example config file looks like this:
{{bc|1=
+
$afraid = "http://freedns.afraid.org/api/?action=getdyndns&sha=%s&style=xml";
+
$CACHEDIR = "/var/cache/afraid-dyndns/IP"; # set cache directory
+
$HASH = "<your_hash>"; # account hash for authentication
+
}}
+
Get the Hashcode:
+
*Visit [http://freedns.afraid.org/api/ http://freedns.afraid.org/api/] and log in.
+
*Copy the shasum from the URL which points to the XML or ASCII API
+
*Replace "<your_hash>" in {{ic|/usr/bin/afraid-dyndns-uv}} with the shasum from the url
+
  
===Automatic Update===
+
daemon=600
The last step is to add this line to your crontab:
+
cache=/tmp/ddclient.cache
{{bc|*,5 * * * * afraid-dyndns-uv}}
+
syslog=yes
It will update the IP every 5 Minutes.
+
 +
use=web, web=checkip.dyndns.com/, web-skip='IP Address'
 +
 +
ssl=yes
 +
 +
## Configuration variables applicable to the 'freedns' protocol are:
 +
#  protocol=freedns            ##
 +
#  server=fqdn.of.service      ## defaults to freedns.afraid.org
 +
#  login=service-login          ## login name and password registered with the service
 +
#  password=service-password    ##
 +
#  fully.qualified.host        ## the host registered with the service.
 +
#
 +
protocol=freedns,                                            \
 +
login=my-freedns.afraid.org-login,                            \
 +
password=my-freedns.afraid.org-password                      \
 +
myhost.afraid.org
 +
 
 +
To enable the [[systemd]] service:
 +
 
 +
systemctl enable ddclient
 +
 
 +
==== cron ====
 +
 
 +
Another option is to:
 +
* goto [http://freedns.afraid.org/dynamic/index.php Dynamic DNS] page on freedns.afraid.org
 +
* add A record and select your prefered domain name
 +
* copy link under '''Direct URL''', it will be something like "<nowiki>http://freedns.afraid.org/dynamic/update.php?ZRRJZ...................bzo4Njc1M4DA</nowiki>"
 +
* use '''crontab -e''' to enter new schedulled command:  
 +
*/10 * * * * curl -ks http://freedns.afraid.org/dynamic/update.php?ZRRJZ...................bzo4Njc1M4DA > /dev/null
 +
 
 +
==== Netctl ====
 +
To add the record of your IP to freedns.afraid.org along with a network connection through the use with [[Netctl]]. You can append the following line to your netctl profile.
 +
{{bc|<nowiki>ExecUpPost='curl -ks http://freedns.afraid.org/dynamic/update.php?ZRRJZ...................bzo4Njc1M4DA'</nowiki>}}
 +
 
 +
=== DynDNS ===
 +
 
 +
[http://dyn.com/dns/ DynDNS] is another Dynamic DNS service.
 +
 
 +
DynDNS can be updated with [http://dyn.com/support/clients/linux/ddclient/ ddclient] or the {{AUR|dyndns}} package in the [[AUR]].
 +
 
 +
=== DNSdynamic ===
 +
 
 +
[http://www.dnsdynamic.org/ DNSdynamic] "will always be absolutely free" and works [https://www.dnsdynamic.org/api.php with ddclient]

Revision as of 10:48, 27 September 2013

Summary help replacing me
Updating Dynamic DNS

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 that may change location on the network.

Router

Many routers have built in DDNS Services but can be limited in the services which they update. If the Router supports a the service, or you are willing to pay or donate for a service, you should do this, it is faster and more reliable. In that case, there is no need to use a softwareside solution.

Software Dynamic DNS

Afraid

FreeDNS.afraid.org is a free Service which is easy and uncomplicated to set up.

There are several options to enable automatic DDNS updating for this provider:

afraid-dyndns

The package afraid-dyndns-uvAUR is available in the AUR.

ddclient

The package ddclient is available in the community repository. It includes systemd support. Unfortunately, it seems to generate broken update URLs for freedns: http://ddclient.tisnix.be/ticket/58

An example config file looks like this:

daemon=600
cache=/tmp/ddclient.cache
syslog=yes

use=web, web=checkip.dyndns.com/, web-skip='IP Address'

ssl=yes

## Configuration variables applicable to the 'freedns' protocol are:
#  protocol=freedns             ##
#  server=fqdn.of.service       ## defaults to freedns.afraid.org
#  login=service-login          ## login name and password registered with the service
#  password=service-password    ##
#  fully.qualified.host         ## the host registered with the service.
#
protocol=freedns,                                             \
login=my-freedns.afraid.org-login,                            \
password=my-freedns.afraid.org-password                       \
myhost.afraid.org

To enable the systemd service:

systemctl enable ddclient

cron

Another option is to:

  • goto Dynamic DNS page on freedns.afraid.org
  • add A record and select your prefered domain name
  • copy link under Direct URL, it will be something like "http://freedns.afraid.org/dynamic/update.php?ZRRJZ...................bzo4Njc1M4DA"
  • use crontab -e to enter new schedulled command:
*/10 * * * * curl -ks http://freedns.afraid.org/dynamic/update.php?ZRRJZ...................bzo4Njc1M4DA > /dev/null

Netctl

To add the record of your IP to freedns.afraid.org along with a network connection through the use with Netctl. You can append the following line to your netctl profile.

ExecUpPost='curl -ks http://freedns.afraid.org/dynamic/update.php?ZRRJZ...................bzo4Njc1M4DA'

DynDNS

DynDNS is another Dynamic DNS service.

DynDNS can be updated with ddclient or the dyndnsAUR package in the AUR.

DNSdynamic

DNSdynamic "will always be absolutely free" and works with ddclient