Afraid Dynamic DNS client in Fedora with Email indicating the changed to original IP.

\"Image
Image via CrunchBase

If you have your domain in the Dynamic DNS located at : Freedns then you know how difficult it is to get the Dynamic DNS client to work with Fedora. Not that it does not work, but you need to configure it properly and there are lot of parameters. But not any more. Now you can install the afraid Dynamic DNS client and just put your Account Hash in the config file and you are ready with the setup to update the DNS entry whenever your IP changes. So lets get started:

sudo yum install afraid-dyndns

Once installed, go to the website and get your account hash and configure the same in the config file located in /etc. File name is /etc/afraid-dyndns.conf

All\’s well till now, but when the Email comes indicating that the IP has been refreshed, there is no other information other than the fact that the IP is refreshed. The previous and the new IP are not there in the mail. So lets fix that so that the same are included.

sudo vi `which afraid-dyndns`

You will get the file that actually updates the Dynamic DNS entry. This is a perl script so should be simple to modify. In my case on Line 117 onwards is the one that we want to modify.

To => $ARGV{Notify},
Subject => \”IP address change from $intip => $extip\”,
Data => \”Dynamic DNS has been refreshed $intip => $extip\”

We will add the part in Fuchisia to add the Previous and current IP in the subject and the body of the mail. So you are done.

Note: You would need the perl MIME lite module for the email to work. The package is not in the requires list and thus will not be automatically installed, so you need to install the module so that mails work for you.

\"Reblog