Hello Internet!

Welcome to our new Blog.

TokenDNS is a api first and truly free dynamic dns service. I build it because I couldn’t find anything suitable for me. Looking for a free service that is offering a little bit more than usual provider was going to be impossible.
Most dynamic dns provider does not allow AAAA records or that I can set my own TTL. In most cases this is not really necessary, but I like to have that freedom. With that in mind TokenDNS was born.

When talking to a DDNS provider you always use a API to update your records – no one wants to do this manually. The API had to be easy to implement in all the different router and operation systems, but on the same site plain and clear.

Note: When using TokenDNS at the moment all subdomains will be registered under blabladns.xyz.

How to use TokenDNS?

1. Register
Before you can use the DDNS service you need to create an account on https://my.tokendns.co/register. When you confirmed your email, you are able to login and receive your API key in the Settings.
This is necessary to make sure that you don’t change any records of your friends, but don’t worry we don’t have any logs.

2. Reserve a name
In the beginning you can only reserve a name using the API. Soon this will be possible through the web interface as well. Its not difficult and can be done with a easy curl request.
In my example I will use www5.blabladns.xyz as an example:

curl --get "https://api.tokendns.co/v1/reserve" \
  -d apikey=${apikey} \
  -d name=www5

When the status is 200 the name was free and you own it now. Congratulations! When you get a 400 someone else was faster and that given name is already gone. Try another!

3. Update your A/AAAA record
If you want to use your subdomain with your own services you need to update the records from time to time. Just another curl request:

curl --get "https://api.tokendns.co/v1/update" \
  -d apikey=${apikey} \
  -d name=www5 \
  -d content=$(curl -4 https://ip.tokendns.co)

You like IPv6, right?

curl --get "https://api.tokendns.co/v1/update" \
  -d apikey=${apikey} \
  -d name=www5 \
  -d type=AAAA \
  -d content=$(curl -6 https://ip.tokendns.co)

You did it! Now you can use your subdomain for whatever you want to use it. The API has some defaults, that can be changed. More about that in the documentation.

3.1 Automation with cron
Whenever we can automate something, we should do this. The easiest way on a Linux/Unix server is using cron to update the records every hour (or whenever you want). We just need to create following file and its taken care of:

echo "0 * * * * root curl -s --get https://api.tokendns.co/v1/update -d apikey=${apikey} -d name=www5 -d content=$(curl -s -4 https://ip.tokendns.co) >/dev/null" > /etc/cron.d/tokendns

4. Check the status
Well sometimes DNS is not the fastest, but you want to make sure that we have the correct information and that your problem will be solved soon. Thats where the status comes into place. Its possible to check for changes before the TTL of your subdomain expires:

curl --get "https://api.tokendns.co/v1/status" \
  -d apikey=${apikey} \
  -d name=www5

I hope you will enjoy TokenDNS and can use it to make your life a little bit easier. New features will arrive soon and more integration guides will be made available. Any question?


UPDATE: At the moment it’s not possible to register with a plus in the email address. Will be fixed soon! Fixed at 26.01 at 10:39pm GMT.

Leave a Reply

Your email address will not be published. Required fields are marked *