Help us understand the problem. What is going on with this article?

Google Public DNS の様々な活用方法

More than 3 years have passed since last update.

概要

Googleが提供している公開DNS(8.8.8.8)をご存じの方は多いと思います。

このGoogle Public DNSには、通常のDNSサーバ接続先として指定する以外にも、複数の利用方法があります。

ブラウザで名前解決

https://dns.google.com にアクセスすることで、ブラウザ上でDNSレコードを参照できます。

dns01.png

dns02.png

DNS-over-HTTPS

DNS-over-HTTPS と呼ばれる仕組みが用意されており、HTTPS経由でDNSレコードを取得できます。実際の情報はJSON形式で提供されます。

次のURLにアクセスすることで利用可能です。
https://dns.google.com/resolve?name=<ドメイン名>

例として、qiita.comを指定すると、以下のようなJSONが取得できます。

json
{
    "Status": 0,
    "TC": false,
    "RD": true,
    "RA": true,
    "AD": false,
    "CD": false,
    "Question": [
        {
            "name": "qiita.com.",
            "type": 1
        }
    ],
    "Answer": [
        {
            "name": "qiita.com.",
            "type": 1,
            "TTL": 55,
            "data": "175.41.239.133"
        }
    ]
}

パラメータ type= を付け加えることにより、DNSレコードタイプを指定できます。
https://dns.google.com/resolve?name=google.com&type=AAAA

json
{
    "Status": 0,
    "TC": false,
    "RD": true,
    "RA": true,
    "AD": false,
    "CD": false,
    "Question": [
        {
            "name": "google.com.",
            "type": 28
        }
    ],
    "Answer": [
        {
            "name": "google.com.",
            "type": 28,
            "TTL": 299,
            "data": "2404:6800:4004:807::200e"
        }
    ],
    "Comment": "Response from 216.239.32.10"
}

参考情報

詳細仕様や、DNS-over-HTTPSのオプションについては、Google公式ページが参考になります。

Google Public DNS

Google Public DNS (DNS-over-HTTPS)

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away