{"id":383,"date":"2013-04-23T14:18:10","date_gmt":"2013-04-23T12:18:10","guid":{"rendered":"http:\/\/bergs.biz\/blog\/?p=383"},"modified":"2015-06-19T09:14:50","modified_gmt":"2015-06-19T07:14:50","slug":"openwrt-and-dns-update","status":"publish","type":"post","link":"https:\/\/bergs.biz\/blog\/2013\/04\/23\/openwrt-and-dns-update\/","title":{"rendered":"OpenWRT and DNS UPDATE"},"content":{"rendered":"<p>I&#8217;m hosting my domain myself on a dedicated root server, and I wanted my Internet router to automatically update a hostname in my own domain (in a designated dynamic zone) with my current public IP. With OpenWRT this was easily accomplished. I used <a href=\"http:\/\/www.foell.org\/justin\/diy-dynamic-dns-with-openwrt-bind\/\" target=\"_blank\">these instructions<\/a> as a starting point.<\/p>\n<p>When trying to check whether everything was set up correctly I always got some strange error from the following command:<\/p>\n<pre># ACTION=update INTERFACE=wan \/sbin\/hotplug-call iface<\/pre>\n<p>It turned out that the following statement<\/p>\n<pre>config_get ipaddr wan ipaddr<\/pre>\n<p>did <em>not<\/em> return the currently assigned IP address in my case, but just an empty response, so I got the following error message:<\/p>\n<pre>could not read rdata\r\nsyntax error<\/pre>\n<p>(For testing I hooked a spare router with a fresh OpenWRT install with the WAN port into my LAN, and configured the WAN interface to receive its IP address via DHCP from out of the LAN. In &#8220;production&#8221; the WAN interface receives its IP via PPPoE.)<\/p>\n<p>Some friendly guy in the OpenWRT forum suggested I try the following instead:<\/p>\n<pre>. \/lib\/functions\/network.sh\r\nnetwork_get_ipaddr ipaddr wan<\/pre>\n<p>And indeed this worked well.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to set up OpenWRT to update a hostname in your own domain with your current IP via dynamic DNS update.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[84,134],"tags":[81,83,82],"class_list":["post-383","post","type-post","status-publish","format-standard","hentry","category-networking-computers","category-routers","tag-dynamic-dns","tag-openwrt","tag-tsig"],"_links":{"self":[{"href":"https:\/\/bergs.biz\/blog\/wp-json\/wp\/v2\/posts\/383","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bergs.biz\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bergs.biz\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bergs.biz\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bergs.biz\/blog\/wp-json\/wp\/v2\/comments?post=383"}],"version-history":[{"count":12,"href":"https:\/\/bergs.biz\/blog\/wp-json\/wp\/v2\/posts\/383\/revisions"}],"predecessor-version":[{"id":863,"href":"https:\/\/bergs.biz\/blog\/wp-json\/wp\/v2\/posts\/383\/revisions\/863"}],"wp:attachment":[{"href":"https:\/\/bergs.biz\/blog\/wp-json\/wp\/v2\/media?parent=383"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bergs.biz\/blog\/wp-json\/wp\/v2\/categories?post=383"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bergs.biz\/blog\/wp-json\/wp\/v2\/tags?post=383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}