ããã«ã¡ã¯ãã»ã¼ã«ã¹ã°ã«ã¼ãã®ä¸å¶(@mnakajima18)ã§ãã
ããã¶ãæãããªã£ã¦ããã®ã§ãåå½ã«ãã©ããé£ã¹ã«è¡ããããªã¨æãä»æ¥ãã®ããã§ãã
ãããã¯äº¬é½ãããã§ãããç¹ã«æ¸ 水寺ã¯æ¥ã®å¤ã®ã©ã¤ãã¢ãããé常ã«ç¶ºéºã¿ããã§ãã
ãããããä»æ¥ããã§ãããä»ããè¡ã£ã¦ãããã§ãããé¨é·ã
ãã¦ãæ©éã§ããã¿ãªããã¯DNSã¯ä½ã使ã£ã¦ãã¾ããã
BINDï¼ã¬ã¸ã¹ãã©ã®æä¾ãµã¼ãã¹ï¼
AWSã«ãRoute 53ã¨ããDNSã®ãµã¼ãã¹ãããã®ããåç¥ã§ããããã
Route 53ã¨ã¯
æ§ã ãªç¹å¾´ã¯ããã¾ããã大ããªã¨ããã¯ãã®ãããªæãã§ãã
éã
å ¨ä¸ç33ç®æã«ãã±ã¼ã·ã§ã³ãé åãã¦ããã®ã§ãã¢ã¯ã»ã¹å ã«ä¸çªè¿ããã±ã¼ã·ã§ã³ã«è»¢éããã
ä¿¡é ¼æ§ãé«ã
SLA100ï¼ ãåèãã¼ã¸âAmazon Route 53 ãµã¼ãã¹ã¬ãã«ã¢ã°ãªã¼ã¡ã³ã
å®ã
1ãã¹ãããã$0.5/æ(æåã®25ãã¹ãã¾ã¼ã³)ã¨100ä¸ã¯ã¨ãªããã$0.5/æ(æåã®10åã¯ã¨ãª/æ)
â»ãåèã¾ã§ã«ãRoute 53ã§ç®¡çãã¦ããå½ç¤¾ã®ã³ã¼ãã¬ã¼ããã¡ã¤ã³(serverworks.co.jp)ã¯$2/æã»ã©ã§ãã
ããã¦ãä½ããè¨å®ãã¨ã£ã¦ãç°¡åãªã®ã§ãã
ãã®é åããä¼ããããï¼
ãããªæãã§ä»æ¥ã¯Route 53ã®åºæ¬çãªè¨å®æé ããç´¹ä»ãã¾ãã
è¨å®æé ã®æµã
ãã®ãããªæµãã§é²ãã¦ããã¾ãã
1.ããã¡ã¤ã³ãåå¾ãã
2.ãRoute 53ã«åå¾ãããã¡ã¤ã³ã®ãã¹ãã¾ã¼ã³ãç»é²ãã
3.ãåã¬ã³ã¼ããè¨å®ãã
4.ãã¬ã¸ã¹ãã©ã®ãã¼ã ãµã¼ãã¼æ å ±ãæ´æ°ãã
1.ããã¡ã¤ã³ãåå¾ãã
ã好ã¿ã®ã¬ã¸ã¹ãã©ãããã¡ã¤ã³ãåå¾ãã¾ãã
ã¬ã¸ã¹ãã©ã¨ã¯ãã¡ã¤ã³åã®ç»é²ç³è«ãåãä»ããæ¥è ã®ãã¨ã§ãã
ä¾ãã°ããåå.comãVALUE-DOMAIN.COMãªã©ãããã¾ãã
ä»åã¯ã ã¼ã ã¼ãã¡ã¤ã³ã§åå¾ãã¦ã¿ã¾ããã
2.ãRoute 53ã«åå¾ãããã¡ã¤ã³ã®ãã¹ãã¾ã¼ã³ãç»é²ãã
Management Consoleã«ãã°ã¤ã³ããRoute 53ã®ãã¼ã¸ãéãã¾ãã
ããããã¨ãã¡ãã®ãããªãã¼ã¸ã«é·ç§»ãã¾ãã®ã§ãCreate Hosted Zoneããã¯ãªãã¯ãã¾ãã
å³å´ã«ãDomain Nameãã¨ãCommentããå ¥åããããã¹ããã©ã¼ã ã表示ããã¾ãã
ãDomain Nameãã«ã¯ãã¡ã¤ã³åããCommentãã«ã¯ãã¡ã¤ã³ã®èª¬æãªã©ãå ¥åãã¾ãã
ä»åã¯Domain Nameï¼m-nakajima18.comãCommentï¼devã¨å ¥åãã¾ããã
ã©ã¡ããå ¥åãã¾ããããæä¸é¨ã®ãCreate Hosted Zoneããã¯ãªãã¯ãã¦å®äºã§ãã
ãã¡ãã®ç»é¢ã®ããã«ãã¹ãã¾ã¼ã³ãç»é²ããã¾ãã
3.ãåã¬ã³ã¼ããè¨å®ãã
ç¶ãã¦åã¬ã³ã¼ããè¨å®ãã¾ãã
該å½ãã¹ãã¾ã¼ã³ã®ãã§ãã¯ããã¯ã¹ã«ãã§ãã¯ãããGo to Record Setsããã¯ãªãã¯ãã¾ãã
ã¬ã³ã¼ãã®è©³ç´°ãã¼ã¸ã«é·ç§»ãã¾ãã
ããã©ã«ãã§ã¯NSã¬ã³ã¼ãã¨SOAã¬ã³ã¼ããè¨å®ããã¦ãã¾ãã
ãã®2ã¤ã®ã¬ã³ã¼ãã¯ç·¨éãã¦ã¯ããã¾ããã
ãããæ°ããã¬ã³ã¼ããè¨å®ãã¦ããã¾ãããã
åã¬ã³ã¼ããè¨å®ããããã«ã¯ãCreate Record Setããã¯ãªãã¯ãã¾ãã
Route 53ã¯9種é¡ã®ã¬ã³ã¼ãã«å¯¾å¿ãã¦ãã¾ããã主ãªã¬ã³ã¼ãã®è¨å®æ¹æ³ã説æãã¦ããã¾ãã
ï¼Aã¬ã³ã¼ãï¼
ãNameãã¯ã«ã¼ããã¡ã¤ã³ã§ããã°ä½ãå ¥åããããµããã¡ã¤ã³ã§ããã°ãµããã¡ã¤ã³ãå ¥åãã¾ãã
ãTypeãã¯AããValueãã¯IPã¢ãã¬ã¹ãå ¥åãã¾ãã
æå¾ã«ãCreate Record Setããã¯ãªãã¯ãã¾ãã
ï¼CNAMEã¬ã³ã¼ãï¼
ãNameãã¯ãµããã¡ã¤ã³ããTypeãã¯CNAMEããValueãã¯å¯¾è±¡ã®FQDNãå ¥åãã¾ãã
æå¾ã«ãCreate Record Setããã¯ãªãã¯ãã¾ãã
ï¼MXã¬ã³ã¼ãï¼
ãNameãã¯ãµããã¡ã¤ã³ããTypeãã¯MXããValueãã¯ããªãã¡ã¬ã³ã¹å¤(åªå 度)ã¨ã¡ã¼ã«ãµã¼ãã¼ã®FQDNãå ¥åãã¾ãã
ä»åã ã¨ãValueãã¯ã10 www.m-nakajima18.comãã¨ãã¦ãããªãã¡ã¬ã³ã¹å¤ã¨FQDNã®éã¯åè§ã¹ãã¼ã¹ãå ¥ãã¾ãã
æå¾ã¯ãCreate Record Setããã¯ãªãã¯ãã¾ãã
ãã¾ãã§Route 53ã®ã¦ãã¼ã¯ãªæ©è½ã説æãã¾ãã
ï¼Aliasæ©è½ï¼
Route 53ã®Aliasæ©è½ã¯AWSã®ãµã¼ãã¹ãçµã¿åããã¦æ§æããéã«ä¾¿å©ã«ä½¿ãã¾ãã
ä¾ãã°ãELBã使ã£ãåé·æ§æã®ã·ã¹ãã ã®å ´åãELBã¯ååãå²ãå½ã¦ãããããCNAMEã§è¨å®ããå¿ è¦ãããã¾ãããURLã¯ãµããã¡ã¤ã³ã使ããããªãã
(ELBã«ã¤ãã¦ã¯ãã¡ããã覧ãã ãã)
ãããªã¨ããRoute 53ã®Aliasæ©è½ã§è¨å®ãã¾ãã
ãNameãã¯ä½ãå ¥åããããTypeãã¯Aã§é常ã®Aã¬ã³ã¼ãã®è¨å®ã¨åãããã«é²ãã¾ãã
ãã®ä¸ã®ãAliasãã¯YesããAlias Targetãã¯é¸æè¢ã表示ãããã®ã§ã対象ã®ELBã®ååãé¸æãã¾ãã
æå¾ã¯ãCreate Record Setãã§å®äºã§ãã
ï¼Routing Policyã«ã¤ãã¦ï¼
Routing Policyã¯DNSã«ã¼ãã£ã³ã°ã®ããªã·ã¼ãæå®ã§ãã¾ãã
ããã©ã«ãã¯ãSimpleãã¨ãªã£ã¦ãããåºæ¬çã«ã¯ãSimpleãã§åé¡ããã¾ããã
ãã®ä»ã®é ç®ã¯ä¸è¨ã®ãããªå 容ã«ãªã£ã¦ãã¾ãã
ãWeightedãã¯DNSã©ã¦ã³ãããã³ã®éã¿ä»ããã§ãã¾ãã
ãLatencyãã¯ãªã¼ã¸ã§ã³ã®ç°ãªãè¤æ°ã®ã¢ãã¬ã¹ãç»é²ããã¨ãã«ãã¢ã¯ã»ã¹å ããæãã¬ã¤ãã³ã·ã¼ãä½ãã¢ãã¬ã¹ãé¸æããã¾ãã
ãFailoverãã¯ããã®è¨å®ã使ãã¨ãµã¤ãããã¦ã³ããå ´åã«ããã¯ã¢ãããµã¤ãã¸èªå°ãããã¨ãã§ãã¾ãããã®æ©è½ã¯å æãªãªã¼ã¹ãããã°ããã§ãã
4.ãã¬ã¸ã¹ãã©ã®ãã¼ã ãµã¼ãã¼æ å ±ãæ´æ°ãã
ã²ã¨éãã¬ã³ã¼ãã®è¨å®ãå®äºãã¾ããã®ã§æå¾ã«ã¬ã¸ã¹ãã©ã®ãã¼ã ãµã¼ãã¼æ å ±ãæ´æ°ãã¾ãã
ãã¼ã ãµã¼ãã¼ã®æ å ±ã¯ãã¡ãã®NSã¬ã³ã¼ããåç §ãã ããã
ç¶ãã¦ã¬ã¸ã¹ãã©(ä»åã¯ã ã¼ã ã¼ãã¡ã¤ã³)ã«ãã°ã¤ã³ãã¾ãã
ãã¼ã ç»é¢ããããã¼ã ãµã¼ãã¼è¨å®å¤æ´ããã¯ãªãã¯ãã¾ãã
ãã¡ã¤ã³ä¸è¦§ãã該å½ã®ãã¡ã¤ã³ãè¦ã¤ãåºããããã¼ã ãµã¼ãã¼è¨å®å¤æ´ããã¯ãªãã¯ãã¾ãã
ã¯ãªãã¯ããã¨ã ã¼ã ã¼ãã¡ã¤ã³ã§åãæ±ã£ã¦ãããã¼ã ãµã¼ãã¼ä¸è¦§ã表示ããã¾ãã®ã§ããä¸è¨ä»¥å¤ã®ãã¼ã ãµã¼ãã使ç¨ããããé¸æããRoute 53ã®ãã¼ã ãµã¼ãã¼ã4ã¤å ¥åãã¾ãã
æå¾ã«æä¸é¨ã®ããã¼ã ãµã¼ãã¼è¨å®å¤æ´ããã¯ãªãã¯ãã¾ãã
ãã®è¨å®ãæå¹ã«ããã¨DNSè¨å®ãã¤ã³ã¿ã¼ãããã«å¯¾ãã¦æå¹ã«ãªãã¾ãã
DNSã®ç§»è¡ãä¿®æ£ãè¡ãå ´åã¯ååã«ã注æãã ããã
ã§ã¯ããã¡ãã¨è¨å®ããããã確èªãã¦ã¿ã¾ãããã
digã§å©ãã¦ã¿ãã¨NSã¬ã³ã¼ãããã¡ãã¨è¨å®ããã¦ãããã¨ããããã¾ãã
$ dig m-nakajima18.com ns ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.26.amzn1 <<>> m-nakajima18.com ns ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46983 ;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;m-nakajima18.com. IN NS ;; ANSWER SECTION: m-nakajima18.com. 172567 IN NS ns-766.awsdns-31.net. m-nakajima18.com. 172567 IN NS ns-1476.awsdns-56.org. m-nakajima18.com. 172567 IN NS ns-1804.awsdns-33.co.uk. m-nakajima18.com. 172567 IN NS ns-61.awsdns-07.com. ;; Query time: 1 msec ;; SERVER: 172.16.0.23#53(172.16.0.23) ;; WHEN: Wed Mar 6 13:31:39 2013 ;; MSG SIZE rcvd: 170
ã¤ãã§ã«Aã¬ã³ã¼ãã確èªãã¦ã¿ã¾ãããã
$ dig www.m-nakajima18.com a ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.26.amzn1 <<>> www.m-nakajima18.com a ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 43281 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;www.m-nakajima18.com. IN A ;; ANSWER SECTION: www.m-nakajima18.com. 300 IN A 54.235.200.182 ;; Query time: 12 msec ;; SERVER: 172.16.0.23#53(172.16.0.23) ;; WHEN: Thu Mar 7 12:16:27 2013 ;; MSG SIZE rcvd: 54
å¼ãã¦ã¾ãããå®ç§ã§ãã
Windowsãã使ãã®å ´åã¯nslookupã«ã¦åæ§ã®ãã¨ãã§ãã¾ãã
ã³ãã³ãããã³ãããéããä¸è¨ã®ã³ãã³ããå©ãã¦è©¦ãã¦ã¿ã¦ãã ããã
- NSã¬ã³ã¼ãï¼ nslookup -type=ns m-nakajima18.com
- Aã¬ã³ã¼ãï¼ãnslookup -type=a www.m-nakajima18.com
ã¾ã¨ã
DNSã®è¨å®ãªãã¦ãカï¾ï½¶ï¾ï½¯â¦ï¾ï½°ï¾!!ãªäººãé»ãç»é¢ã§ããæä½ã§ããªãã¨æãããã¡ã§ããã女ååã ãã§ç°¡åã«è¨å®ã§ãã¾ããã
Route 53ã¯å¯ç¨æ§ãé常ã«é«ãAWSãµã¼ãã¹ã¨ã®ç¸æ§ãããã®ã§ãAWSä¸ã§ç°å¢ãç¨æããå ´åã¯DNSãRoute 53ãæ¤è¨ãã¦ããããã¨ããããããªããã¨æãã¾ãã
ããã¦å©ç¨æéãå®ãã§ãããããã¾ãã¯AWSã試ãã¦ã¿ããæ¹ã«ã¯ã¨ã£ããããããã®ã§ã¯ãªãã§ããããã
ãã²ãã²ã試ããï¼