Difference between revisions of "Dynamic DNS"

From ArchWiki
Jump to: navigation, search
(Software: Fix for whatismyip.com blocking the perl requests.)
m (Software: typo fixed)
Line 20: Line 20:
 
{{Note|Besides {{Pkg|perl}}, it depends on {{Pkg|perl-libwww}} and {{Pkg|perl-xml-simple}} available in the [[Official Repositories]].}}
 
{{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 pearl SWP requests, replace the line
+
Because whatismyip.com seems to block perl SWP requests, replace the line
 
{{bc|1=$extip = get("http://automation.whatismyip.com/n09230945.asp"); # Fetch current IP from whatismyip}}
 
{{bc|1=$extip = get("http://automation.whatismyip.com/n09230945.asp"); # Fetch current IP from whatismyip}}
 
by
 
by

Revision as of 05:37, 28 June 2012

Summary help replacing me
Setting up Dynamic DNS for Homeservers

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.

Router or Server?

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. 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.

Setting up DDNS

Service

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

Software

After signing up there, install afraid-dyndns-uvAUR, available in the Arch User Repository. It updates the IP.

Note: Besides perl, it depends on perl-libwww and perl-xml-simple available in the Official Repositories.

Because whatismyip.com seems to block perl SWP requests, replace the line

$extip = get("http://automation.whatismyip.com/n09230945.asp"); # Fetch current IP from whatismyip

by

$extip = get("http://api.externalip.net/ip/"); # Fetch current IP from externalip.net

in /usr/bin/afraid-dyndns-uv.

Configuration

After building and installing the package, configuration of /usr/bin/afraid-dyndns-uv (which is a perl script) is necessary.

Locate the Lines

$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/ and log in.
  • Copy the shasum from the URL which points to the XML or ASCII API
  • Replace "<your_hash>" in /usr/bin/afraid-dyndns-uv with the shasum from the url

Automatic Update

The last step is to add this line to your crontab:

*,5 * * * * afraid-dyndns-uv

It will update the IP every 5 Minutes.