{"id":2204,"date":"2018-01-16T21:59:21","date_gmt":"2018-01-16T12:59:21","guid":{"rendered":"https:\/\/www.ecomott.co.jp\/tech_blog\/?p=2204"},"modified":"2018-09-13T09:38:07","modified_gmt":"2018-09-13T00:38:07","slug":"%e3%81%a7%e3%81%8d%e3%82%8b%e3%81%a0%e3%81%91%e6%89%8b%e8%bb%bd%e3%81%abdns%e3%82%ad%e3%83%a3%e3%83%83%e3%82%b7%e3%83%a5%e3%82%b5%e3%83%bc%e3%83%90%e3%82%92%e7%ab%8b%e3%81%a6%e3%82%8b","status":"publish","type":"post","link":"https:\/\/test.ecomottblog.com\/?p=2204","title":{"rendered":"\u624b\u8efd\u306bDNS\u30ad\u30e3\u30c3\u30b7\u30e5\u30b5\u30fc\u30d0\u3092\u7acb\u3066\u308b\u65b9\u6cd5\u306f\uff1f"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3002\u958b\u767a\u90e8\u306e\u677e\u6c38\u3067\u3059\u3002<\/p>\n<p>DNS\u30b5\u30fc\u30d0\u3068\u3044\u3048\u3070\u3001\u30a8\u30b3\u30e2\u30c3\u30c8\u3067\u306fAWS Route53\u3092\u4f7f\u3046\u3053\u3068\u304c\u591a\u3044\u3067\u3059\u3002\u4fa1\u683c\u7684\u306b\u624b\u8efd\u306a\u306e\u306f\u3082\u3061\u308d\u3093\u306e\u3053\u3068\u3001API\u3092\u7d4c\u7531\u3057\u3066\u30b3\u30fc\u30c9\u3067\u7ba1\u7406\u3067\u304d\u308b\u306e\u304c\u9b45\u529b\u7684\u3067\u3059\u3002<\/p>\n<p>\u306a\u306e\u3067\u3001\u5168\u90e8Route53\u306b\u304a\u4efb\u305b\u30fc\uff01\u3068\u3044\u304d\u305f\u3044\u306e\u3067\u3059\u304c\u3001\u306a\u304b\u306a\u304b\u305d\u3046\u3082\u3044\u304b\u305a\u3002\u30ed\u30fc\u30ab\u30eb\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u5185\u306bDNS\u3092\u305f\u3066\u306a\u304d\u3083\u3044\u3051\u306a\u3044\u30b1\u30fc\u30b9\u3082\u307e\u3060\u307e\u3060\u3042\u308a\u307e\u3059\u3002\u4eca\u65e5\u306f\u305d\u3093\u306a\u3068\u304d\u306e\u305f\u3081\u306b\u3001\u624b\u9593\u3092\u304b\u3051\u305a\u306b\u7acb\u3061\u4e0a\u3052\u3089\u308c\u308bPowerDNS\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<br \/>\n<!--more--><\/p>\n<h2>PowerDNS\u3068\u306f\uff1f<\/h2>\n<p>\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306eDNS\u30b5\u30fc\u30d0\u3067\u3059\u3002\u30e9\u30a4\u30bb\u30f3\u30b9\u306fGPL\u3002DNS\u30b3\u30f3\u30c6\u30f3\u30c4\u30b5\u30fc\u30d0\u306b\u76f8\u5f53\u3059\u308b\u300cPowerDNS\u300d\u3068\u3001\u30ad\u30e3\u30c3\u30b7\u30e5\u30b5\u30fc\u30d0\u306b\u76f8\u5f53\u3059\u308b\u300cPowerDNS recursor\u300d\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u7279\u5fb4\u3068\u3057\u3066\u306f\u3001\u30be\u30fc\u30f3\u60c5\u5831\u306e\u6301\u3061\u65b9\u304c\u591a\u69d8\u3067\u3057\u3066\u3001MySQL\u3084PostgreSQL\u306a\u3069\u306eRDBMS\u3084\u3001Bind\u5f62\u5f0f\u306e\u30be\u30fc\u30f3\u30d5\u30a1\u30a4\u30eb\u306b\u3082\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002\u975e\u5e38\u306b\u67d4\u8edf\u306a\u7ba1\u7406\u304c\u3067\u304d\u305d\u3046\u3067\u3059\u3002\u307e\u305f\u3001PowerDNS\u3068PowerDNS recursor\u306f\u72ec\u7acb\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u3069\u3061\u3089\u304b\u7247\u65b9\u306e\u307f\u3092\u7acb\u3061\u3052\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<h2>\u30b4\u30fc\u30eb<\/h2>\n<p>\u4eca\u56de\u306f\u958b\u767a\u74b0\u5883\u306b\u4f7f\u3046\u5834\u5408\u306a\u3069\u3001\u6700\u3082\u624b\u8efd\u3068\u601d\u308f\u308c\u308b\u65b9\u6cd5\u3067DNS\u30ad\u30e3\u30c3\u30b7\u30e5\u30b5\u30fc\u30d0\u3092\u7acb\u3066\u3066\u307f\u307e\u3059\u3002\u30bd\u30fc\u30f3\u60c5\u5831\u306f\u3001hosts\u30d5\u30a1\u30a4\u30eb\u3092\u4f7f\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u5909\u66f4\u304c\u983b\u7e41\u3067\u3042\u3063\u305f\u308a\u3001\u30ec\u30b3\u30fc\u30c9\u6570\u304c\u591a\u304b\u3063\u305f\u308a\u3059\u308b\u3068\u5927\u5909\u3067\u3059\u304c\u3001\u30a8\u30c7\u30a3\u30bf\u3067\u7c21\u5358\u306b\u5909\u66f4\u3067\u304d\u308b\u306e\u3067\u975e\u5e38\u306b\u697d\u3067\u3059\u3002<\/p>\n<h2>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304a\u3088\u3073\u8a2d\u5b9a<\/h2>\n<p>\u300cPowerDNS recursor\u300d\u306e\u307f\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<br \/>\n\u524d\u63d0\u3068\u3057\u3066\u3001EPEL\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u6709\u52b9\u306b\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><code># yum install pdns-recursor\n<\/code><\/pre>\n<p>\u6b21\u306b\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre><code># vi \/etc\/pdns-recursor\/recursor.conf \n<\/code><\/pre>\n<p>Bind\u3059\u308bIP\u30a2\u30c9\u30ec\u30b9\u306f\u3001local-address\u3067\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre><code>local-address=0.0.0.0\n<\/code><\/pre>\n<p>\u30ed\u30fc\u30ab\u30eb\u4ee5\u5916\u304b\u3089\u306e\u554f\u3044\u5408\u308f\u305b\u3092\u8a31\u53ef\u3059\u308b\u5834\u5408\u306f\u3001allow-from\u306bIP\u30a2\u30c9\u30ec\u30b9\u7bc4\u56f2\u3092\u30ab\u30f3\u30de\u533a\u5207\u308a\u3067\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre><code>allow-from=127.0.0.0\/8,192.168.2.0\/24 \n<\/code><\/pre>\n<p>\/etc\/hosts\u30d5\u30a1\u30a4\u30eb\u3092\u30be\u30fc\u30f3\u60c5\u5831\u3068\u3059\u308b\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3092\u6709\u52b9\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre><code>etc-hosts-file=\/etc\/hosts\nexport-etc-hosts=on\n<\/code><\/pre>\n<p>\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u306a\u304b\u3063\u305f\u5834\u5408\u306b\u3001\u554f\u3044\u5408\u308f\u305b\u3092\u30d5\u30a9\u30ef\u30fc\u30c9\u3059\u308b\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3002<\/p>\n<pre><code>forward-zones-recurse=.=8.8.8.8\n<\/code><\/pre>\n<p>\u8a2d\u5b9a\u3092\u78ba\u8a8d\u3057\u3001\u30b5\u30fc\u30d3\u30b9\u306e\u516c\u958b\u7bc4\u56f2\u3092\u3057\u3063\u304b\u308a\u3068\u78ba\u8a8d\u3057\u305f\u4e0a\u3067\u3001\u8d77\u52d5\u3057\u307e\u3059\u3002<br \/>\n<a href=\"https:\/\/www.nic.ad.jp\/ja\/dns\/openresolver\/\">\u203b\u30aa\u30fc\u30d7\u30f3\u30ea\u30be\u30eb\u30d0(Open Resolver)\u306b\u5bfe\u3059\u308b\u6ce8\u610f\u559a\u8d77<\/a><\/p>\n<pre><code># service pdns-recursor start\nStarting pdns-recursor:                                    [  OK  ]\n<\/code><\/pre>\n<p>\u3053\u308c\u3067\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n<p>\u5b9f\u969b\u306b\u30c6\u30b9\u30c8\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u307e\u305a\u306fhosts\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre><code>192.168.10.2 myserver.localdomain\n<\/code><\/pre>\n<p>DNS\u30ad\u30e3\u30c3\u30b7\u30e5\u30b5\u30fc\u30d0\u306b\u5909\u66f4\u3055\u308c\u305fhosts\u3092\u8aad\u307f\u8fbc\u307e\u305b\u308b\u305f\u3081\u306b\u518d\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<pre><code># service pdns-recursor restart\nStopping pdns-recursor:                                    [  OK  ]\nStarting pdns-recursor:                                    [  OK  ]\n<\/code><\/pre>\n<h2>\u30c6\u30b9\u30c8\uff01<\/h2>\n<p>dig\u30b3\u30de\u30f3\u30c9\u3067\u30c6\u30b9\u30c8\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><code># dig myserver.localdomain @127.0.0.1 +short\n192.168.10.2\n<\/code><\/pre>\n<p>\u6210\u529f\u3067\u3059\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3002\u958b\u767a\u90e8\u306e\u677e\u6c38\u3067\u3059\u3002 DNS\u30b5\u30fc\u30d0\u3068\u3044\u3048\u3070\u3001\u30a8\u30b3\u30e2\u30c3\u30c8\u3067\u306fAWS Route53\u3092\u4f7f\u3046\u3053\u3068\u304c\u591a\u3044\u3067\u3059\u3002\u4fa1\u683c\u7684\u306b\u624b\u8efd\u306a\u306e\u306f\u3082\u3061\u308d\u3093\u306e\u3053\u3068\u3001API\u3092\u7d4c\u7531\u3057\u3066\u30b3\u30fc\u30c9\u3067\u7ba1\u7406\u3067\u304d\u308b\u306e\u304c\u9b45\u529b\u7684\u3067\u3059\u3002 \u306a\u306e\u3067\u3001\u5168\u90e8Route [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":2212,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[31],"_links":{"self":[{"href":"https:\/\/test.ecomottblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2204"}],"collection":[{"href":"https:\/\/test.ecomottblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/test.ecomottblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/test.ecomottblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/test.ecomottblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2204"}],"version-history":[{"count":11,"href":"https:\/\/test.ecomottblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2204\/revisions"}],"predecessor-version":[{"id":2219,"href":"https:\/\/test.ecomottblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2204\/revisions\/2219"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/test.ecomottblog.com\/index.php?rest_route=\/wp\/v2\/media\/2212"}],"wp:attachment":[{"href":"https:\/\/test.ecomottblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2204"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/test.ecomottblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2204"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/test.ecomottblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2204"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}