
本記事の目的
先日の技術書典6で、購入者特典でもらった「DNSをはじめよう~基礎からトラブルシューティングまで~」を読んだら、任意のサイトのURL(ドメイン)から簡単に、提供企業や利用サービスが確認できるようだったので試してみました。
本文
「DNSをはじめよう」とは?
BOOTHになる紹介文より抜粋
技術書典5で紙の本740冊が 2時間半で完売してしまった大人気のDNS本です。
続編の「AWSをはじめよう」と合わせて累計販売数は5,500冊超え!
https://mochikoastech.booth.pm/items/1032590
(中略)
DNSをはじめよう
~基礎からトラブルシューティングまで~技術同人誌(PDF) / 148ページ / ¥1000
ドメインを買って試しながら学べるドリル付き
・ドメインとDNSの仕組みが丸ごと分かる
・DNS浸透問題のモヤモヤをすっきり解決
・トラブルシューティング!困ったときの調べ方は?
・nslookupはもう卒業!digの便利な使い方
・ドメイン自動更新の落とし穴によるサイト全停止の防ぎ方
・実際に手を動かして試してみよう!AWSのRoute53
・IT系にいるけどインフラに苦手意識のあるあなたに
・これからシステムを学ぶ新人にも最適な入門書
とのことです。
実は、自分が技術書典に興味をもったきっかけの本だったり。
試してみた
digコマンドやwhoisコマンドを利用すると、任意のサイトのURL(ドメイン)から簡単に、提供企業や利用サービスが確認できるようだったので、興味本位でいつか何かの役に立つかもと、試してみました。
itedge.stars.ne.jpの場合
書籍の中ではサンプルのサイトを利用していましたが、せっかくなのでこのブログのドメイン(itedge.stars.ne.jp)を利用してみます。
・環境
$ cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.6 (Maipo)
・digコマンドで対象ドメインのIPアドレス確認
[opc@comp-ap01 ~]$ dig itedge.stars.ne.jp +short 157.112.187.16
ちなみに、hostコマンドやnslookupコマンドでも同様の情報が確認可能。
[opc@comp-ap01 ~]$ host -t a itedge.stars.ne.jp itedge.stars.ne.jp has address 157.112.187.16 [opc@comp-ap01 ~]$ nslookup itedge.stars.ne.jp Server: 169.254.169.254 Address: 169.254.169.254#53 Non-authoritative answer: Name: itedge.stars.ne.jp Address: 157.112.187.16
・whoisコマンドで該当IPアドレスからドメイン情報を確認
opc@comp-ap01 ~]$ whois 157.112.187.16 [Querying whois.arin.net] [Redirected to whois.apnic.net] [Querying whois.apnic.net] [whois.apnic.net] % [whois.apnic.net] % Whois data copyright terms http://www.apnic.net/db/dbcopyright.html % Information related to '157.112.176.0 - 157.112.191.255' % Abuse contact for '157.112.176.0 - 157.112.191.255' is 'hostmaster@nic.ad.jp' inetnum: 157.112.176.0 - 157.112.191.255 netname: BETINC descr: XSERVER Inc.★ descr: GRAND FRONT OSAKA TOWER A 13F,4-20, descr: Ofukacho,Kita-ku,Osaka-city country: JP admin-c: JNIC1-AP tech-c: JNIC1-AP status: ALLOCATED PORTABLE remarks: Email address for spam or abuse complaints : abuse@xserver.co.jp mnt-irt: IRT-JPNIC-JP mnt-by: MAINT-JPNIC mnt-lower: MAINT-JPNIC mnt-routes: MAINT-JPNIC last-modified: 2013-05-31T05:40:03Z source: APNIC (後略)
⇒itedge.stars.ne.jpのドメイン提供元が、「XSERVER Inc」であることが確認できた。
XSERVERさん、とてもお世話になってます。
qiita.comの場合
続いて、せっかくなのでブログ投稿先として併用しているQiitaについても調べてみます。
・まずはdigコマンド
[opc@comp-ap01 ~]$ dig qiita.com a +short 54.249.114.15 54.250.61.12 52.68.45.253
⇒複数のIPアドレスが登録されているケースもある。
・例として、一個目のIPアドレスを確認してみる
[opc@comp-ap01 ~]$ whois 54.249.114.15 [Querying whois.arin.net] [whois.arin.net] # # ARIN WHOIS data and services are subject to the Terms of Use # available at: https://www.arin.net/resources/registry/whois/tou/ # # If you see inaccuracies in the results, please report at # https://www.arin.net/resources/registry/whois/inaccuracy_reporting/ # # Copyright 1997-2019, American Registry for Internet Numbers, Ltd. # # start NetRange: 54.248.0.0 - 54.249.255.255 CIDR: 54.248.0.0/15 NetName: AMAZO-ZNRT1 NetHandle: NET-54-248-0-0-1 Parent: AMAZON-2011L (NET-54-240-0-0-1) NetType: Reallocated OriginAS: AS16509 Organization: Amazon.com, Inc. (AMAZO-4) RegDate: 2012-01-10 Updated: 2012-10-26 Ref: https://rdap.arin.net/registry/ip/54.248.0.0 OrgName: Amazon.com, Inc. OrgId: AMAZO-4 Address: Amazon Web Services, Inc. Address: P.O. Box 81226 City: Seattle StateProv: WA PostalCode: 98108-1226 Country: US RegDate: 2005-09-29 Updated: 2018-09-19 Comment: For details of this service please see Comment: http://ec2.amazonaws.com Ref: https://rdap.arin.net/registry/entity/AMAZO-4 OrgAbuseHandle: AEA8-ARIN OrgAbuseName: Amazon EC2 Abuse★ OrgAbusePhone: +1-206-266-4064 OrgAbuseEmail: abuse@amazonaws.com OrgAbuseRef: https://rdap.arin.net/registry/entity/AEA8-ARIN OrgNOCHandle: AANO1-ARIN OrgNOCName: Amazon AWS Network Operations OrgNOCPhone: +1-206-266-4064 OrgNOCEmail: amzn-noc-contact@amazon.com OrgNOCRef: https://rdap.arin.net/registry/entity/AANO1-ARIN OrgTechHandle: ANO24-ARIN OrgTechName: Amazon EC2 Network Operations OrgTechPhone: +1-206-266-4064 OrgTechEmail: amzn-noc-contact@amazon.com OrgTechRef: https://rdap.arin.net/registry/entity/ANO24-ARIN # end
⇒な、なるほど。どうやらAWSさんのサービスで運営されているようです。
(マナーの範囲内で)興味のあるサイトのドメイン情報を調べてみるのは面白い気がする。
techbookfest.orgの場合(2019/5/5追記)
技術書典6で買った公式ガイドブックを読んでいたら、技術書典のWebサイトはGCPのApp Engineで作っている、という話が書いてあったので、該当Webサイト(https://techbookfest.org)の情報をdigコマンドで確認してみた。
※調べ方が正しいかを、調べるためのテスト
・まずはdigコマンド
[opc@comp-ap01 ~]$ dig techbookfest.org a +short 216.239.34.21 216.239.32.21 216.239.36.21 216.239.38.21
・例として、一個目のIPアドレスを確認してみる
[opc@comp-ap01 ~]$ whois 216.239.34.21 [Querying whois.arin.net] [whois.arin.net] # # ARIN WHOIS data and services are subject to the Terms of Use # available at: https://www.arin.net/resources/registry/whois/tou/ # # If you see inaccuracies in the results, please report at # https://www.arin.net/resources/registry/whois/inaccuracy_reporting/ # # Copyright 1997-2019, American Registry for Internet Numbers, Ltd. # NetRange: 216.239.32.0 - 216.239.63.255 CIDR: 216.239.32.0/19 NetName: GOOGLE NetHandle: NET-216-239-32-0-1 Parent: NET216 (NET-216-0-0-0-0) NetType: Direct Allocation OriginAS: Organization: Google LLC (GOGL) RegDate: 2000-11-22 Updated: 2012-02-24 Ref: https://rdap.arin.net/registry/ip/216.239.32.0 (以下、省略)
⇒App Engineを利用しているかは不明だけど、googleさんのサービスを使ってることは類推できそう。
コマンドヘルプメモ
・dig
[opc@comp-ap01 ~]$ dig -v DiG 9.9.4-RedHat-9.9.4-73.el7_6 [opc@comp-ap01 ~]$ dig -help Usage: dig [@global-server] [domain] [q-type] [q-class] {q-opt} {global-d-opt} host [@local-server] {local-d-opt} [ host [@local-server] {local-d-opt} [...]] Where: domain is in the Domain Name System q-class is one of (in,hs,ch,...) [default: in] q-type is one of (a,any,mx,ns,soa,hinfo,axfr,txt,...) [default:a] (Use ixfr=version for type ixfr) q-opt is one of: -x dot-notation (shortcut for reverse lookups) -i (use IP6.INT for IPv6 reverse lookups) -f filename (batch mode) -b address[#port] (bind to source address/port) -p port (specify port number) -q name (specify query name) -t type (specify query type) -c class (specify query class) -k keyfile (specify tsig key file) -y [hmac:]name:key (specify named base64 tsig key) -4 (use IPv4 query transport only) -6 (use IPv6 query transport only) -m (enable memory usage debugging) d-opt is of the form +keyword[=value], where keyword is: +[no]vc (TCP mode) +[no]tcp (TCP mode, alternate syntax) +time=### (Set query timeout) [5] +tries=### (Set number of UDP attempts) [3] +retry=### (Set number of UDP retries) [2] +domain=### (Set default domainname) +bufsize=### (Set EDNS0 Max UDP packet size) +ndots=### (Set NDOTS value) +[no]edns[=###] (Set EDNS version) [0] +[no]search (Set whether to use searchlist) +[no]showsearch (Search with intermediate results) +[no]defname (Ditto) +[no]recurse (Recursive mode) +[no]ignore (Don't revert to TCP for TC responses.) +[no]fail (Don't try next server on SERVFAIL) +[no]besteffort (Try to parse even illegal messages) +[no]aaonly (Set AA flag in query (+[no]aaflag)) +[no]adflag (Set AD flag in query) +[no]cdflag (Set CD flag in query) +[no]cl (Control display of class in records) +[no]cmd (Control display of command line) +[no]comments (Control display of comment lines) +[no]rrcomments (Control display of per-record comments) +[no]question (Control display of question) +[no]answer (Control display of answer) +[no]authority (Control display of authority) +[no]additional (Control display of additional) +[no]stats (Control display of statistics) +[no]short (Disable everything except short form of answer) +[no]ttlid (Control display of ttls in records) +[no]all (Set or clear all display flags) +[no]qr (Print question before sending) +[no]nssearch (Search all authoritative nameservers) +[no]identify (ID responders in short answers) +[no]trace (Trace delegation down from root [+dnssec]) +[no]dnssec (Request DNSSEC records) +[no]nsid (Request Name Server ID) +[no]sigchase (Chase DNSSEC signatures) +trusted-key=#### (Trusted Key when chasing DNSSEC sigs) +[no]topdown (Do DNSSEC validation top down mode) +[no]split=## (Split hex/base64 fields into chunks) +[no]multiline (Print records in an expanded format) +[no]onesoa (AXFR prints only one soa record) global d-opts and servers (before host name) affect all queries. local d-opts and servers (after host name) affect only that lookup. -h (print help and exit) -v (print version and exit)
・whois
[opc@comp-ap01 ~]$ whois -help jwhois version 4.0, Copyright (C) 1999-2007 Free Software Foundation, Inc. This program is free software with ABSOLUTELY NO WARRANTY; you may redistribute it under the terms of the GNU General Public License. Usage: jwhois [OPTIONS] [QUERY] --version display version number and patch level --help display this help -v, --verbose verbose debug output -c FILE, --config=FILE use FILE as configuration file -h HOST, --host=HOST explicitly query HOST -n, --no-redirect disable content redirection -s, --no-whoisservers disable whois-servers.net service support -a, --raw disable reformatting of the query -i, --display-redirections display all redirects instead of hiding them -p PORT, --port=PORT use port number PORT (in conjunction with HOST) -r, --rwhois force an rwhois query to be made --rwhois-display=DISPLAY sets the display option in rwhois queries --rwhois-limit=LIMIT sets the maximum number of matches to return Report bugs to bug-jwhois@gnu.org
以上
Leave a Reply