{"id":62,"date":"2012-12-27T04:03:14","date_gmt":"2012-12-27T04:03:14","guid":{"rendered":"https:\/\/www2.harwoodfamily.id.au\/index.php\/2012\/12\/27\/ubuntu-server-register-in-dns\/"},"modified":"2020-05-06T05:17:41","modified_gmt":"2020-05-06T05:17:41","slug":"ubuntu-server-register-in-dns","status":"publish","type":"post","link":"https:\/\/www.harwoodfamily.au\/index.php\/2012\/12\/27\/ubuntu-server-register-in-dns\/","title":{"rendered":"Ubuntu Server Register in DNS"},"content":{"rendered":"<p>To register an Ubuntu server with static networking details into DNS, create this script as &#8220;reg_dns.sh&#8221; in \/root<\/p>\n<hr \/>\n<p>#!\/bin\/bash<br \/># Description:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 registers this server in the default DNS server<\/p>\n<p>HOST=`hostname -f`<br \/>IP=`\/sbin\/ifconfig eth0 | sed -n &#8216;\/inet addr:\/s=[^:]*:\\([^ ]*\\).*=\\1=;2p&#8217;`<\/p>\n<p>#echo &#8220;server 192.168.72.1&#8221; &gt; \/tmp\/nsupdate.txt<br \/>echo &#8220;key DHCP_UPDATER fKsyqnH7YTXmX1LPd8HKqw==&#8221; &gt; \/tmp\/nsupdate.txt<br \/>#echo &#8220;key DHCP_UPDATER fKsyqnH7YTXmX1LPd8HKqw==&#8221; &gt;&gt; \/tmp\/nsupdate.txt<br \/>echo &#8220;update add $HOST 86400 a $IP&#8221; &gt;&gt; \/tmp\/nsupdate.txt<br \/>echo &#8220;send&#8221; &gt;&gt; \/tmp\/nsupdate.txt<\/p>\n<p>nsupdate -v \/tmp\/nsupdate.txt<\/p>\n<hr \/>\n<p>make the script executable:<\/p>\n<p>chmod ug+x \/root\/reg_dns.sh<\/p>\n<hr \/>\n<p>and add the following to the end of \/etc\/rc.local before the &#8220;exit 0&#8221; line<\/p>\n<p>\/root\/reg_dns.sh<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To register an Ubuntu server with static networking details into DNS, create this script as &#8220;reg_dns.sh&#8221; in \/root #!\/bin\/bash# Description:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 registers this server in the default DNS server HOST=`hostname -f`IP=`\/sbin\/ifconfig eth0 | sed -n &#8216;\/inet addr:\/s=[^:]*:\\([^ ]*\\).*=\\1=;2p&#8217;` #echo &#8220;server 192.168.72.1&#8221; &gt; \/tmp\/nsupdate.txtecho &#8220;key DHCP_UPDATER fKsyqnH7YTXmX1LPd8HKqw==&#8221; &gt; \/tmp\/nsupdate.txt#echo &#8220;key DHCP_UPDATER fKsyqnH7YTXmX1LPd8HKqw==&#8221; &gt;&gt; \/tmp\/nsupdate.txtecho &#8220;update add $HOST [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-62","post","type-post","status-publish","format-standard","hentry","category-it-tip-articles"],"_links":{"self":[{"href":"https:\/\/www.harwoodfamily.au\/index.php\/wp-json\/wp\/v2\/posts\/62","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.harwoodfamily.au\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.harwoodfamily.au\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.harwoodfamily.au\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.harwoodfamily.au\/index.php\/wp-json\/wp\/v2\/comments?post=62"}],"version-history":[{"count":1,"href":"https:\/\/www.harwoodfamily.au\/index.php\/wp-json\/wp\/v2\/posts\/62\/revisions"}],"predecessor-version":[{"id":88,"href":"https:\/\/www.harwoodfamily.au\/index.php\/wp-json\/wp\/v2\/posts\/62\/revisions\/88"}],"wp:attachment":[{"href":"https:\/\/www.harwoodfamily.au\/index.php\/wp-json\/wp\/v2\/media?parent=62"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.harwoodfamily.au\/index.php\/wp-json\/wp\/v2\/categories?post=62"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.harwoodfamily.au\/index.php\/wp-json\/wp\/v2\/tags?post=62"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}