{"id":24,"date":"2013-07-07T14:25:21","date_gmt":"2013-07-07T05:25:21","guid":{"rendered":"http:\/\/gomocool.net\/gomokulog\/?p=24"},"modified":"2014-07-31T10:47:16","modified_gmt":"2014-07-31T01:47:16","slug":"dynamicdns-%e3%83%a0%e3%83%bc%e3%83%a0%e3%83%bc%e3%83%89%e3%83%a1%e3%82%a4%e3%83%b3%e3%81%a8mydns-jp-2","status":"publish","type":"post","link":"https:\/\/gomokulog.gomocool.net\/?p=24","title":{"rendered":"DynamicDNS (\u30e0\u30fc\u30e0\u30fc\u30c9\u30e1\u30a4\u30f3\u3068myDNS.jp) 2"},"content":{"rendered":"<p>\u4eca\u56de\u306f\u3001<a href=\"http:\/\/gomocool.net\/gomokulog\/?p=10\">\u524d\u56de<\/a>\u306e MyDNS.jp \u3078\u306eIP\u66f4\u65b0 \u3092 \u81ea\u52d5\u5316\u3059\u308b\u3002<\/p>\n<p>\u3055\u3066\u3001\u524d\u56de\u306fDynamicDNS\u3067\u3042\u308bMyDNS.jp\u306bIP\u30a2\u30c9\u30ec\u30b9\u3092\u899a\u3048\u3055\u305b\u3066\u3001<br \/>\n\u81ea\u5206\u306e\u30c9\u30e1\u30a4\u30f3\u3067\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3068\u601d\u3046\u3002<br \/>\n\u3057\u304b\u3057\u3001\u6bce\u56de\u6bce\u56de\u4f55\u6642\u5909\u308f\u308b\u304b\u5206\u304b\u3089\u306a\u3044IP\u30a2\u30c9\u30ec\u30b9\u3092\u3001\u624b\u52d5\u3067\u66f4\u65b0\u3059\u308b\u306e\u306f\u5b9f\u969b\u7121\u7406\u3002<br \/>\n\u3067\u306f\u3001\u3069\u3046\u3059\u308b\u304b\u3068\u3044\u3046\u3068\u3001\u81ea\u52d5\u3067\u5b9a\u671f\u7684\u306bIP\u30a2\u30c9\u30ec\u30b9\u3092MyDNS.jp\u306b\u4f1d\u3048\u3066\u3042\u3052\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n<p>\u3055\u3066\u3001\u305d\u306e\u65b9\u6cd5\u306fMyDNS.jp \u306e\u4f7f\u3044\u65b9\u3092\u307f\u308b\u3068<\/p>\n<ul>\n<li>\u30e1\u30fc\u30eb\u30bd\u30d5\u30c8\u3067\u5b9a\u671f\u7684\u306b\u53d7\u4fe1\u3057\u306b\u3044\u304f\u3002<\/li>\n<li>Linux\u306ecron\u306b\u5b9a\u671f\u7684\u306bwget\u3064\u304b\u3063\u3066\u30a2\u30af\u30bb\u30b9\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u304f\u3002<\/li>\n<\/ul>\n<p>\u306e\u4e8c\u7a2e\u985e\u3060\u3063\u305f\u3002<\/p>\n<p>\u30e1\u30fc\u30eb\u30bd\u30d5\u30c8\u3060\u3068\u78ba\u304b\u306b\u8a2d\u5b9a\u306f\u7c21\u5358\u3060\u3051\u3069\u3001\u30eb\u30fc\u30bf\u30fc\u5185\u306eWindows\u30de\u30b7\u30f3\u3092\u7acb\u3061\u4e0a\u3052\u3063\u3071\u306a\u3057\u306b\u3059\u308b\u3053\u3068\u306b\u306a\u308b\u3002<br \/>\n\u96fb\u6c17\u4ee3\u3082\u3063\u305f\u3044\u306a\u3044\uff01\u3000\u30b9\u30de\u30fc\u30c8\u3058\u3083\u306a\u3044\uff01<br \/>\n\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u5f8c\u8005\u306e\u624b\u6bb5\u3092\u3068\u308b\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3>Linux\u306ecron\u3067\u5b9a\u671f\u7684\u306bwget\u3064\u304b\u3063\u3066\u30a2\u30af\u30bb\u30b9\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u304f\u3002<\/h3>\n<p>\u305b\u3063\u304b\u304f\u3001\u30b5\u30fc\u30d0\u30fc\u3092\u7acb\u3066\u308b\u3093\u3060\u3057\u3001\u30b5\u30fc\u30d0\u30fc\u306b\u3084\u3089\u305b\u306a\u3044\u3068\u306d\u3002<br \/>\n\u3055\u3066\u3001MyDNS.jp\u3055\u3093\u3092\u53c2\u8003\u306b\u5c11\u3057\u5909\u66f4\u3059\u308b\u3002<br \/>\n\u25cb\u30eb\u30fc\u30c8\u306ecron\u3067\u306f\u306a\u304f\u3001\u5225\u30a2\u30ab\u30a6\u30f3\u30c8\u306ecron\u3067\u5b9f\u884c\u3059\u308b\u3002<br \/>\n\u306a\u305c\u306a\u3089\u3001root\u306ecron\u306b\u306f\u306a\u3093\u3068\u306a\u304f\u89e6\u308a\u305f\u304f\u306a\u304b\u3063\u305f\u304b\u3089\u3002<br \/>\n\u25cb\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3060\u3051\u3060\u3068\u3001\u672c\u5f53\u306b\u30a2\u30af\u30bb\u30b9\u3055\u308c\u3066\u308b\u306e\u304b\u4e0d\u5b89\u306a\u306e\u3067\u30ed\u30b0\u3092\u6b8b\u3059\u3002<br \/>\n\u25cb\u30a2\u30af\u30bb\u30b9\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u5225\u306b\u4f5c\u6210\u3057\u3066\u3001cron\u306b\u306f\u305d\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u5b9f\u884c\u3055\u305b\u308b\u3002<\/p>\n<p>\u307e\u305a\u306f\u3001\u4f5c\u6210\u3059\u308b\u30e6\u30fc\u30b6\u30fc\u306b\u306a\u308a\u3001\u30e6\u30fc\u30b6\u30fc\u306e\u30db\u30fc\u30e0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067\u3001<\/p>\n<pre class=\"lang:sh decode:true \">$vi wget_mydns.sh<\/pre>\n<p>\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3002<br \/>\n\u4e2d\u8eab\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3002<\/p>\n<pre class=\"lang:sh decode:true \">#!\/bin\/bash\r\nmydnsLogPath=\/home\/gomokuro\/mydns.log\r\necho `date` &gt;&gt; ${mydnsLogPath}\r\nwget -O - 'http:\/\/mydns123456:******@www.mydns.jp\/login.html' | grep 'login_status\\|MASTERID \\|REMOTE ADDRESS\\|ACCESS DAYTIME\\|SERVER ADDRESS' &gt;&gt; ${mydnsLogPath}\r\necho -e \"\\r\\n\" &gt;&gt; ${mydnsLogPath}<\/pre>\n<p>&nbsp;<\/p>\n<p>\u3084\u3063\u3066\u308b\u3053\u3068\u306f\u3001\u7c21\u5358\u3002<br \/>\n\u30fb\u672c\u65e5\u306e\u65e5\u4ed8\u3092\u30ed\u30b0\u306b\u5410\u304f\u3002<br \/>\n\u30fbmydns\u306bHTTP\u3067\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3001\u305d\u306e\u8fd4\u3063\u3066\u304f\u308bHTML\u306e\u306a\u304b\u3067\u5fc5\u8981\u305d\u3046\u306a\u884c\u3092grep\u3067\u53d6\u5f97\u3057\u3066\u30ed\u30b0\u306b\u5410\u304f\u3002<br \/>\n\u30fb\u6700\u5f8c\u306b\u30ed\u30b0\u3092\u898b\u3084\u3059\u304f\u3059\u308b\u305f\u3081\u306b\u6539\u884c\u3092\u3044\u308c\u308b\u3002<\/p>\n<p>\u3060\u304c\u3001\u3053\u306e\u307e\u307e\u3067\u306f\u52d5\u304b\u306a\u3044\u3002<br \/>\n<span class=\"lang:sh decode:true  crayon-inline \">$chmod 775 .\/wget_mydns.sh<\/span><br \/>\n\u3067\u3001\u5b9f\u884c\u6a29\u3092\u3064\u3051\u3066\u3042\u3052\u308b\u3002<br \/>\n\u305d\u3057\u3066\u3001<br \/>\n<span class=\"lang:sh decode:true  crayon-inline \">$.\/wget_mydns.sh\u00a0 <\/span><br \/>\n\u3067\u8a66\u3057\u306b\u5b9f\u884c\u3057\u3066\u307f\u308b\u3002<br \/>\n\u3061\u3083\u3093\u3068mydns.log\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u308c\u3070\u30b9\u30af\u30ea\u30d7\u30c8\u30d5\u30a1\u30a4\u30eb\u306f\u5b8c\u6210\u3002<\/p>\n<p>\u6b21\u306bcron\u306b\u767b\u9332\u3059\u308b\u3002$crontab -e<br \/>\n\u3092\u5b9f\u884c\u3059\u308b\u3002<br \/>\n\u305d\u3057\u3066\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3059\u308b\u3002<\/p>\n<pre style=\"background-color: #f0fff0;\"><code>SHELL=\/bin\/bash\r\nPATH=\/sbin:\/bin:\/user\/sbin:\/usr\/bin:\/usr\/local\/bin\r\nMAILTO=\"\"\r\n\r\n20 * * * * \/home\/gomokuro\/wget_mydns.sh\r\n<\/code><\/pre>\n<p>\u3053\u308c\u3067\u30011\u6642\u9593\u3054\u3068\u306b20\u5206\u306b\u306a\u3063\u305f\u3089\u30b9\u30af\u30ea\u30d7\u30c8\u30d5\u30a1\u30a4\u30eb\u304c\u5b9f\u884c\u3055\u308c\u308b\u3002<br \/>\n\u3053\u306e\u3042\u305f\u308a\u306e\u983b\u5ea6\u306f\u597d\u307f\u3067\u5224\u65ad\u3002\u4e00\u77ac\u3067\u3082\u30da\u30fc\u30b8\u306b\u7e4b\u304c\u3089\u306a\u304f\u306a\u308b\u306e\u304c\u5acc\u306a\u65b9\u306f\u6570\u5206\u3054\u3068\u306b\u3057\u3066\u3082\u3088\u3044\u3002<br \/>\n5\u5206\u6bce\u306b\u5b9f\u884c\u3057\u305f\u3044\u5834\u5408\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306b\u66f8\u304f\u3002<br \/>\n<code>*\/5 * * * * \/home\/gomokuro\/wget_mydns.sh<\/code><\/p>\n<p>\u4ee5\u4e0a\u3067\u3001\u81ea\u52d5\u3067IP\u30a2\u30c9\u30ec\u30b9\u3092\u4f1d\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3068\u601d\u308f\u308c\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u56de\u306f\u3001\u524d\u56de\u306e MyDNS.jp \u3078\u306eIP\u66f4\u65b0 \u3092 \u81ea\u52d5\u5316\u3059\u308b\u3002 \u3055\u3066\u3001\u524d\u56de\u306fDynamicDNS\u3067\u3042\u308bMyDNS.jp\u306bIP\u30a2\u30c9\u30ec\u30b9\u3092\u899a\u3048\u3055\u305b\u3066\u3001 \u81ea\u5206\u306e\u30c9\u30e1\u30a4\u30f3\u3067\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3068\u601d\u3046\u3002 \u3057\u304b\u3057\u3001\u6bce\u56de\u6bce\u56de\u4f55&hellip;  <a href=\"https:\/\/gomokulog.gomocool.net\/?p=24\" class=\"more-link\">more <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[3,4,5],"class_list":["post-24","post","type-post","status-publish","format-standard","hentry","category-server","tag-centos","tag-dynamic-dns","tag-5"],"_links":{"self":[{"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/posts\/24","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=24"}],"version-history":[{"count":13,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/posts\/24\/revisions"}],"predecessor-version":[{"id":241,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/posts\/24\/revisions\/241"}],"wp:attachment":[{"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=24"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=24"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=24"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}