The Mythic Beasts DNS API makes it very easy to implement dynamic DNS — a system for updating a DNS entry for a host that regularly changes its IP address.
The API provides a URL that will detect the IP address of the client and use that to set a DNS record.
In order to use the DNS API for dynamic DNS, you will need to create some API credentials. This can be done using the API keys page in the control panel.
It is recommended that you create credentials that only have access to the
hostname that you want to update. The screenshot below shows how to create an
API key with access to
AAAA records for
To update the IP address for the record show above, make a request to:
We suggest making a
POST request, but
PUT requests will work too.
The username and password for your API key can be provided as parameters to the
For example, if you are using curl, you can make the following request:
curl https://ipv4.api.mythic-beasts.com/dns/v2/dynamic/myhost.example.com -d username=MYUSER -d password=MYPASS
Using query paramaters
If you are using a dynamic DNS client that requires the username and password to be embedded in the URL, you can use query parameters:
Using HTTP basic auth
If you are using curl, we recommend using HTTP basic authentication, and putting the credentials in a .netrc file. For example, create a .netrc file in your home directory containing:
machine ipv4.api.mythic-beasts.com login MY_USER password MY_PASS
You can now use the
-n option to curl to use these credentials:
curl -n -X https://ipv4.api.mythic-beasts.com/dns/v2/dynamic/myhost.example.com
IPv4 vs IPv6
The above examples use an IPv4-only URL to access the API. This ensures that
the API detects your IPv4 address if you have both v4 and v6 addresses, and
will create or update an
If you want to update a record based on your IPv6 address, simply use
ipv6.api.mythic-beasts.com as the API hostname. This will create or update