REST-DNS is a project for web developers those who need to get DNS information but cannot create raw requests. The platform we target on is Web-Browser Extensions (such as Firefox Extensions, Chrome Extensions), Google App Engine, and so on. On such application platform, you can create HTTP request but cannot create DNS request by yourself. This is very useful for Javascript users. We provide simple interface based on REST architecture, that answers DNS request, so that you can use DNS information for your applications. You may also get DNSSEC RRs from REST-DNS if you want; We don't provide you the information whether the RR is verified or not.
{
"A": [
"192.0.32.10"
],
"AAAA": [
"2620:0:2D0:200::10"
],
"SOA": [
{
"serial": 2010073621,
"retry": 3600,
"mname": "dns1.icann.org",
"refresh": 7200,
"minimum": 3600,
"rname": "",
"expire": 1209600
},
{
"serial": 2010073621,
"retry": 3600,
"mname": "dns1.icann.org",
"refresh": 7200,
"minimum": 3600,
"rname": "",
"expire": 1209600
}
],
"hostname": "example.org"
}
We provide DNS records with dictionary records. For each types of records, the records will be given in a list.
Each element of the list is either a dictionary or a simple string.
For A, AAAA, MX, NS, TEXT, the element will be a simple string.
For MX, SOA, the element will be a dictionary.
#!ruby
require 'net/http'
require 'json'
res = Net::HTTP.get('restdns.net', '/example.org/soa')
rd = JSON.parse(res)
rd["SOA"][0]["serial"]