Editdns.pl is a Perl script that lets you add and delete DNS records for your domains hosted at EditDNS.net from the command line. You can use it to automatically set up DNS records for dynamic IP address connections (in those cases when DynDNS records are not good enough).
Before using the script, open it in a text editor and enter your
EditDNS e-mail address and password as
The script reads a sequence of commands from its standard input. Three commands are recognized:
||add a new DNS record with the specified set of fields|
||delete an existing record that matches the specified criteria|
||delete all existing records that match the specified criteria|
Command parameters are entered as field name, followed by a colon,
then the value enclosed in double quotes (
Here's an example of an
Add-Record Name:"www.example.com." Type:"A" AUX:"1" TTL:"86400" Data:"220.127.116.11"
This command adds a new A record named
"www.example.com.", with an IP address of
18.104.22.168. When adding a record, you need to enter all
the required parameters, ie. name, record type, AUX, TTL, and data.
Delete-Record command has similar syntax, but in
this case the provided parameters are used to locate the existing DNS
record that will be deleted. It's not necessary to enter all the
parameters, you can just supply one, eg.:
Delete the record named "mail.example.com.":
If more than one parameter is provided, the command looks for the first record that matches ALL the parameters (as if there was a logical AND), eg.:
Delete the MX record for example.com:
Delete-Record Name:"example.com." Type:"MX"
Additionally, you can use regular expressions with
Delete-Record. To use a regular expression, enclose it
in double quotes and put a tilde (
~) character in front
of it, eg.:
Delete the example.com A record whose data starts with
Delete-Record Name:"example.com." Type:"A" Data:~"^192\.168"
You can also do negative regular expression matching. Precede the
tilde character with a bang (
Delete the example.com MX record whose data doesn't start with
Delete-Record Name:"example.com." Type:"MX" Data:!~"^mail\."
Delete-All-Records command works the same way as
Delete-Record, but, as the name implies, it deletes all
the records that match the given criteria.
The script determines the domain that the record belongs to based on
"Name" parameter, but you can enter the
domain name explicitly using the
Delete all CNAME records for the
Delete-All-Records Domain:"example.com." Type:"CNAME"
If you're using a regular expression match for the
"Name" parameter, you MUST supply the domain name
Delete a record that starts with
Delete-Record Domain:"example.com." Name:~"^www"