How to use DynDNS with your router

The most common way to use Dynamic DNS is with your home router at home. You want to have access to the data that you store at home from far away. The problem is that your internet provider is changing it’s IP address from time to time and no one wants to remember these numbers.

We are introducing a new feature today to make it possible to use it with any device that is supporting an update interface.

https://api.tokendns.co/v1/update?apikey=APIKEY&name=SUBDOMAIN

It is not necessary anymore to add the record content when updating. This allows you to use it where ever you want.
Let’s have a look at a Fritzbox configuration that many people are using:

The only important setting is the update url, all other values can be chosen freely.

You are coding your IoT at home or remote and need access to it? Arduino can be that simple:

http.begin("http://api.tokendns.co/v1/update?apikey=APIKEY&name=SUBDOMAIN");
int httpCode = http.GET();
if(httpCode > 0) {
	if(httpCode == HTTP_CODE_OK) {
		String payload = http.getString();
		JsonObject& json = jsonBuffer.parseObject(payload);
		if (!json.success()) {
			Serial.println("Parsing payload failed");
		} else {
			String status = json["status"];
			// do something with it 
	} else {
		Serial.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str());
}
http.end();

This opens a lot of possibilities and looking forward to hear where you can integrate TokenDNS in your systems to make your life’s a bit easier.

We love the Insomnia REST Client

We love APIs and the Insomnia REST Client is perfect to test new things. You can use it for free and is available for Linux, MacOSX and Windows.

Sometimes it is just easier to get started when you have something on hands. Grab our Insomnia configuration for our TokenDNS API on github and start playing. Add your apikey and domain after importing to get started.

Its never been easier to get productive.

How to use Google Cloud with TokenDNS

When you are using the Google Cloud Platform, you want to automate as much as possible. We want to help!

Starting a new machine in GCE is not a difficult thing and luckily it’s possible to supply a startup script and some metadata to automate the registration of the new machine with TokenDNS.

Configure Startup Script

We need to use a little helper script to make the dns registration. Don’t worry we published it on github.com for you to grab. The register_tokendns.sh script will get executed when the VM starts and use some metadata information that we configured to register it with TokenDNS.
Copy the content of the register_tokendns.sh script and paste it in the Startup Script section when you add a new virtual machine.

Add Metadata

The metadata that we configure are apikey and domain. These are necessary information that you need to provide, otherwise the registration will fail. It would be possible to extend the script to add e.g. tags.

Lets have a look at the Console in the Google Cloud how it should look:

If you want to learn more about GCE and Startup scripts you can look here. They even tell you how to use the CLI and scripts 😉

You own your data. Here is how to export them!

We believe that you should be able to access your data anytime you want. Most DNS provider does not give you the possibility to export all your records without knowing them. You should be able to do so anyways.
That’s why we implemented an export function for all your records. This makes it easier to keep an eye on them and make an backup of your records (just in case).

Request:

curl --get "https://api.tokendns.co/v1/export" \
  -d apikey=${apikey} \
  -d action=records \
  -d domain=${domain}

Response:

{
  "status": "200",
  "domain": "blabladns.xyz",
  "records": [
    [
      {
        "name": "blabladns.xyz",
        "type": "TXT",
        "content": "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCFPb9PnIJB8z2Ev+C+jmNPVVLxGMeqDNKOoa9/9R/C6rgRkLcxFHAB4ibbr7h7ybngirME0jsn4ZgBsweaRSfqdj5Arka1luqEAKxaBW6K6pi9HDvRpWQzFdwQriUcWyyIVsCjYEQLZJdZOD8nX9sJk5u+ihlumstZaTIIUFA/jQIDAQAB",
        "ttl": "300",
        "change_date": "1485196067",
        "tag": ""
      },
      {
        "name": "asd.blabladns.xyz",
        "type": "A",
        "content": "127.0.0.5",
        "ttl": "300",
        "change_date": "1471774941",
        "tag": ""
      },
      {
        "name": "asd.blabladns.xyz",
        "type": "A",
        "content": "10.10.10.10",
        "ttl": "300",
        "change_date": "1485419347",
        "tag": ""
      },
      {
        "name": "facebook.blabladns.xyz",
        "type": "A",
        "content": "188.166.134.65",
        "ttl": "300",
        "change_date": "1469030691",
        "tag": ""
      },
      {
        "name": "facebook.blabladns.xyz",
        "type": "MX",
        "content": "127.0.0.1",
        "ttl": "300",
        "change_date": "1469030795",
        "tag": ""
      },
      {
        "name": "insomnia.blabladns.xyz",
        "type": "A",
        "content": "178.62.218.50",
        "ttl": "300",
        "change_date": "1481653536",
        "tag": "website"
      },
      {
        "name": "www.blabladns.xyz",
        "type": "A",
        "content": "8.8.8.8",
        "ttl": "300",
        "change_date": "1469028995",
        "tag": ""
      },
      {
        "name": "www3.blabladns.xyz",
        "type": "A",
        "content": "127.0.0.12",
        "ttl": "300",
        "change_date": "1483823787",
        "tag": "website"
      }
    ]
  ]
}

API Documentation and our Libraries are updated and ready to get explored.

How to verify your domain?

When registering a new domain with us you need to verify that you are the owner of the domain. Why? Otherwise you could make some spooky things that we do not approve.

How to verify your ownership?

At the moment we offer three ways to verify a domain. We call it HTTP, DNS or Email. Every option has its own pro and cons. Lets explain them one by one.

Email

The most common and easiest option is Email. You need to have access to one of the following email address. As example we are using example.org which you need to replace with the domain you want to register.

webmater@example.org
admin@example.org

When you register the domain example.org you can specify one of the two mentioned recipients. You will receive an Email with a verification link which you need to open to verify your ownership.
This is very easy and in the normal case very fast. If you don’t have access to these emails, check out the other options.

HTTP

If you don’t have access to Email one other fast way is to use http verification.
After registering your domain with us, you will find some information in the web interface or in the callback of the api call .

What are we expecting? You need to create a html file in your domain root directory with a specific content. This means you need to have access to your current webserver or application.

In the example above you can see that you need to create a file called tokendns-site-verification-febaf9c6a1e96e60.html with the content 657f7c1ff545dff91c39bb56ff653ea4cb177257.
Just create the file and we will take care of the rest and inform you when the domain is validated. In the meanwhile you can start and create your records.

DNS

Our last, but not less used option is by dns. This means that you need to create a TXT record with your current dns provider. If this is easy and fast depends a little bit on your current provider, but most of the times its fast as well.
Lets give you an example how easy it is with us:

The get the necessary informations how the records needs to look is the same way as our http example. Easy to check in the web interface or when you use the api in the callback.

In the end your DNS server needs to responds with something like this:

$ dig example.org txt +short
tokendns-site-verification=7163bf009221f7e4

In the future we might add more options or email recipients, but at the moment this should offer a wide variety and gives everyone a possibility to verify the ownership of the domain.

Let us know if you need something else 🙂

How to add Messenger notifications to TokenDNS?

What is Messenger?

Messenger is probably one of the most used messenger in the world and everyone who has a Facebook account is using it. After we introduced Facebook as authentication method, its now possible to get notifications when your records changed. No need for any additional app on your phone.

What do I need to use Messenger with TokenDNS?

Its very easy. When you are logged in TokenDNS, just open the Messenger site and click Send to Messenger. Thats it!

Visit my.tokendns.co/messenger now.

 

I want to use the API!

Unfortunately this is not possible 🙁

 

How to add PagerDuty notification to TokenDNS?

pagerduty

What is PagerDuty?

PagerDuty is present in most companies who have on call duty. Most are using it in combination with several monitoring systems. Its easy to handle schedules and organise responsibilities.

What do I need to use PagerDuty with TokenDNS?

For obvious reason you need to have an account for PagerDuty. In PagerDuty you can create so called Services and for each service you can create a Integrations. Each integration has a service key and this is what we need.

Now login to PagerDuty and select the Service that should receive notifications from us:
Configuration -> Services -> Select or Create a Service
If you already have a service, go to Integrations and add a new integration:

pagerduty-1

Please select “Use our API directly” and set a proper name. After hitting the green button you will redirect to the previous page and you can see your Integration Key. This key is our token.
We have everything what we need and can enable notification in TokenDNS. Go to your settings and add PagerDuty to your notifications.

blabladns-add-notification

I want to use the API!

I hear you and like it. Easy as you know it:

curl --get "https://api.tokendns.co/v1/notifications" \
  -d apikey=${apikey} \
  -d action=add
  -d provider=pagerduty
  -d description=${service_description}
  -d token=${token_id}

How to add Pushover notification to TokenDNS?

pushover

What is Pushover?

Pushover is an app that allows you to send custom messages in realtime to your iOS, Android and other devices. It’s very reliable and easy to use.

What do I need to use Pushover with TokenDNS?

You need to register with pushover.net and have at least one app installed on your device. To use BlaBlaDNS with pushover you need to create an Application and obtain User ID and API Token.

When you are logged in pushover you need to create a new application. Go to Applications and click Register an Application.

pushover-register

Afterwards you need to add the details of the application. Give it a name, description and type (e.g. Website) and add a good looking logo. You can grab the TokenDNS Logo here. At the end hit Create Application.

pushover-register-app

When the application is created you can get the API Token from the application details. Just click on the Application name and obtain the token.

pushover-token

Yes, its the one behind that good looking black banner. Whats next? We need the User ID. This you have probably seen. Its on the main page at the top right corner.

How to enable Pushover Notifications?

When you have your API Token and User ID we can enable Pushover notification in TokenDNS. When you are logged in, go to Settings and select Pushover in the dropdown menu.

blabladns-add-notification

You will be prompted to add your credentials. Hit Add Notification and the next time you reserve or change a record you will receive a notification.

Screenshot_20160427-203132

I want to use the API!

I hear you and like it. Easy as you know it:

curl --get "https://api.tokendns.co/v1/notifications" \
  -d apikey=${apikey} \
  -d action=add
  -d provider=pushover
  -d user=${user_id}
  -d token=${token_id}

How to add Slack notification to TokenDNS?

slack

What is Slack?

Slack is a team communication platform. Nowadays it’s used widely in many companies and makes it very easy to communicate and share files with your colleagues. If you don’t know it, its worth to take a look.

What do I need to use Slack with TokenDNS?

For obvious reason you need to have an account with Slack. Log into TokenDNS, go to Settings and select Slack from the pulldown menu.

blabladns-add-notification

You will get redirected to Slack where you can select the channel where the messages will get delivered. Nothing easier than adding Slack as a notification. Want to see one?

blabladns-notification-slack

I want to use the API!

I hear you, but unfortunately its not possible to add Slack notification with the api. Why? Not our fault!

How to add Email notification to TokenDNS?

email-email-447458_640

How to enable Email Notifications?

One of the easiest and oldest communication channels in the digital age that still exist. What you need? An Email address.
Go to Settings and select Email in the pulldown menu.

blabladns-add-notification

You will be prompted to add your credentials. Hit Add Notification and the next time you reserve or change a record you will receive a notification.

I want to use the API!

I hear you and like it. Easy as you know it:

curl --get "https://api.tokendns.co/v1/notifications" \
  -d apikey=${apikey} \
  -d action=add
  -d provider=email
  -d recipient=${email_address}