Configuration

In the script directory, there is a file containing some information that must be specified to make it run on your server. Locate the file config.pl in the script directory.

The first section contains information for when an external web page is used to determine the IP address to update with. This is useful if you don't have ifconfig (a program to get information about network cards) on your system, or if you are behind a firewall/router with port forwarding set up. Set $config{'getip_ext'}' to 1, and specify a web location with a service for determining your external IP address, and store this in $config{'getip_ext_url'}. (Of course you will want to use the DNS Made Easy service, which is the default.)

The second section contains settings for when internal IP address discovery should be used. First of all, the network interface card is very important. Most people use eth0 as the primary network adapter, which gets the IP address from the DHCP server. Is this not the one used on your system, this line must be changed to reflect the correct configuration of your system. Further on in the settings defines the command used to parse the IP address on the system.

Last, but certainly not least, is the URL used to update all IP address changes. This must not be changed, or the script will not function correctly.

config.pl: Configuration of DME Update


########################################
#
# Start configuring here
#

# EXTERNAL IP ADDRESS DISCOVERY
#
# Use external method of obtaining IP address
$config{'getip_ext'} = 1;

# URL to get IP address to router
$config{'getip_ext_url'} = "http://www.dnsmadeeasy.com/myip.jsp";



# INTERNAL IP ADDRESS DISCOVERY
#
# The preferred way is to get IP externally. If, for some reason,
# you want to get your IP address internally, set $getip_ext = 1 above,
# and use the preferred $ifconfig_cmd below. Two examples are given,
# for Unix and Linux. You may need change this command to suit your
# distibution/OS.
#
# Program to get IP address internally
$getip_int = "ifconfig";

# Network adapter
$nic = "eth0";

# Unix command
$config{'ifconfig_cmd'} = "$getip_int $nic | grep 'inet ' | awk '{ print \$2 }'";

# Linux command
#$config{'ifconfig_cmd'} = "$getip_int $nic | grep 'inet addr' | awk '{ print \$2 }' | awk -F: '{ print \$2 }'";



# UPDATES
#
# URL to IP update servlet
$config{'update_url'} = "https://www.dnsmadeeasy.com/servlet/updateip";

#
# Stop configuring here
#
########################################