{"id":345,"date":"2019-03-15T12:21:59","date_gmt":"2019-03-15T10:21:59","guid":{"rendered":"http:\/\/www.busted.dk\/blog\/?p=345"},"modified":"2025-03-11T13:28:54","modified_gmt":"2025-03-11T11:28:54","slug":"automatic-set-register-this-connections-addresses-in-dns-for-a-vpn-connection","status":"publish","type":"post","link":"https:\/\/www.busted.dk\/blog\/automatic-set-register-this-connections-addresses-in-dns-for-a-vpn-connection\/","title":{"rendered":"Automatic set &#8220;Register this connection\u2019s addresses in DNS&#8221; for a VPN connection"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Using PowerShell\nto create a VPN connection on a Windows 10 is quite easy. I used this command to\ncreate a VPN connection to a Meraki router.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ServerAddress = \"x.x.x.x\"\n$ConnectionName = \"XXX\"\n$PresharedKey = \"XXX\"\nAdd-VpnConnection -Name \"$ConnectionName\" -ServerAddress \"$ServerAddress\" -RememberCredential -TunnelType L2tp -AllUserConnection -L2tpPsk \"$PresharedKey\" -AuthenticationMethod Pap -Force<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">But\nwhat about if you want to add the clients VPN IP adress in your DNS?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Default\n\u201cRegister this connection\u2019s addresses in DNS\u201d for a VPN connection is not\nenabled and it is not possible to enable with the Add-VpnConnection PowerShell\ncommand.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"394\" height=\"483\" src=\"https:\/\/www.busted.dk\/blog\/wp-content\/uploads\/2019\/03\/DNS2-1.jpg\" alt=\"\" class=\"wp-image-348\" srcset=\"https:\/\/www.busted.dk\/blog\/wp-content\/uploads\/2019\/03\/DNS2-1.jpg 394w, https:\/\/www.busted.dk\/blog\/wp-content\/uploads\/2019\/03\/DNS2-1-245x300.jpg 245w\" sizes=\"auto, (max-width: 394px) 100vw, 394px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Off course you can set it manually but if you want to do it automatically and deploy the setting you have to edit the Remote Access Phonebook with PowerShell<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If\nit is a -alluserconnection the phonebook can be found here:\n&#8220;C:\\ProgramData\\Microsoft\\Network\\Connections\\Pbk\\rasphone.pbk&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If\nit is a per user connection the phonebook can be found here:\n&#8220;C:\\Users\\USERNAME\\AppData\\Roaming\\Microsoft\\Network\\Connections\\Pbk\\rasphone.pbk&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Use\nthis Powershell command to set the setting:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$RASPhoneBook = \"C:\\ProgramData\\Microsoft\\Network\\Connections\\Pbk\\rasphone.pbk\"\n(Get-Content $RASPhoneBook) -Replace 'IpDnsFlags=0', 'IpDnsFlags=3' | Set-Content $RASPhoneBook<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Using PowerShell to create a VPN connection on a Windows 10 is quite easy. I used this command to create a VPN connection to a Meraki router. But what about if you want to add the clients VPN IP adress in your DNS? Default \u201cRegister this connection\u2019s addresses in DNS\u201d for a VPN connection is &#8230; <a title=\"Automatic set &#8220;Register this connection\u2019s addresses in DNS&#8221; for a VPN connection\" class=\"read-more\" href=\"https:\/\/www.busted.dk\/blog\/automatic-set-register-this-connections-addresses-in-dns-for-a-vpn-connection\/\" aria-label=\"Read more about Automatic set &#8220;Register this connection\u2019s addresses in DNS&#8221; for a VPN connection\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":348,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,1,21],"tags":[23,20],"class_list":["post-345","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-network","category-uncategorized","category-vpn","tag-dns","tag-vpn"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Automatic set &quot;Register this connection\u2019s addresses in DNS&quot; for a VPN connection - Peter Busted<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.busted.dk\/blog\/automatic-set-register-this-connections-addresses-in-dns-for-a-vpn-connection\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Peter\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.busted.dk\\\/blog\\\/automatic-set-register-this-connections-addresses-in-dns-for-a-vpn-connection\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.busted.dk\\\/blog\\\/automatic-set-register-this-connections-addresses-in-dns-for-a-vpn-connection\\\/\"},\"author\":{\"name\":\"Peter\",\"@id\":\"https:\\\/\\\/www.busted.dk\\\/blog\\\/#\\\/schema\\\/person\\\/6f1b95dddb508da8b018577701c33c9d\"},\"headline\":\"Automatic set &#8220;Register this connection\u2019s addresses in DNS&#8221; for a VPN connection\",\"datePublished\":\"2019-03-15T10:21:59+00:00\",\"dateModified\":\"2025-03-11T11:28:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.busted.dk\\\/blog\\\/automatic-set-register-this-connections-addresses-in-dns-for-a-vpn-connection\\\/\"},\"wordCount\":162,\"publisher\":{\"@id\":\"https:\\\/\\\/www.busted.dk\\\/blog\\\/#\\\/schema\\\/person\\\/6f1b95dddb508da8b018577701c33c9d\"},\"image\":{\"@id\":\"https:\\\/\\\/www.busted.dk\\\/blog\\\/automatic-set-register-this-connections-addresses-in-dns-for-a-vpn-connection\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.busted.dk\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/DNS2-1.jpg\",\"keywords\":[\"DNS\",\"VPN\"],\"articleSection\":{\"0\":\"Network\",\"2\":\"VPN\"},\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.busted.dk\\\/blog\\\/automatic-set-register-this-connections-addresses-in-dns-for-a-vpn-connection\\\/\",\"url\":\"https:\\\/\\\/www.busted.dk\\\/blog\\\/automatic-set-register-this-connections-addresses-in-dns-for-a-vpn-connection\\\/\",\"name\":\"Automatic set \\\"Register this connection\u2019s addresses in DNS\\\" for a VPN connection - Peter Busted\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.busted.dk\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.busted.dk\\\/blog\\\/automatic-set-register-this-connections-addresses-in-dns-for-a-vpn-connection\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.busted.dk\\\/blog\\\/automatic-set-register-this-connections-addresses-in-dns-for-a-vpn-connection\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.busted.dk\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/DNS2-1.jpg\",\"datePublished\":\"2019-03-15T10:21:59+00:00\",\"dateModified\":\"2025-03-11T11:28:54+00:00\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.busted.dk\\\/blog\\\/automatic-set-register-this-connections-addresses-in-dns-for-a-vpn-connection\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.busted.dk\\\/blog\\\/automatic-set-register-this-connections-addresses-in-dns-for-a-vpn-connection\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.busted.dk\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/DNS2-1.jpg\",\"contentUrl\":\"https:\\\/\\\/www.busted.dk\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/DNS2-1.jpg\",\"width\":394,\"height\":483},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.busted.dk\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.busted.dk\\\/blog\\\/\",\"name\":\"Peter Busted\",\"description\":\"A blog about my daily work with tech and more, running since 2008\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.busted.dk\\\/blog\\\/#\\\/schema\\\/person\\\/6f1b95dddb508da8b018577701c33c9d\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.busted.dk\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.busted.dk\\\/blog\\\/#\\\/schema\\\/person\\\/6f1b95dddb508da8b018577701c33c9d\",\"name\":\"Peter\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.busted.dk\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/cropped-f819f80c-bdd3-4653-87cc-89c692229010.webp\",\"url\":\"https:\\\/\\\/www.busted.dk\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/cropped-f819f80c-bdd3-4653-87cc-89c692229010.webp\",\"contentUrl\":\"https:\\\/\\\/www.busted.dk\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/cropped-f819f80c-bdd3-4653-87cc-89c692229010.webp\",\"width\":1790,\"height\":357,\"caption\":\"Peter\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.busted.dk\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/cropped-f819f80c-bdd3-4653-87cc-89c692229010.webp\"},\"url\":\"https:\\\/\\\/www.busted.dk\\\/blog\\\/author\\\/peter\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Automatic set \"Register this connection\u2019s addresses in DNS\" for a VPN connection - Peter Busted","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.busted.dk\/blog\/automatic-set-register-this-connections-addresses-in-dns-for-a-vpn-connection\/","twitter_misc":{"Written by":"Peter","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.busted.dk\/blog\/automatic-set-register-this-connections-addresses-in-dns-for-a-vpn-connection\/#article","isPartOf":{"@id":"https:\/\/www.busted.dk\/blog\/automatic-set-register-this-connections-addresses-in-dns-for-a-vpn-connection\/"},"author":{"name":"Peter","@id":"https:\/\/www.busted.dk\/blog\/#\/schema\/person\/6f1b95dddb508da8b018577701c33c9d"},"headline":"Automatic set &#8220;Register this connection\u2019s addresses in DNS&#8221; for a VPN connection","datePublished":"2019-03-15T10:21:59+00:00","dateModified":"2025-03-11T11:28:54+00:00","mainEntityOfPage":{"@id":"https:\/\/www.busted.dk\/blog\/automatic-set-register-this-connections-addresses-in-dns-for-a-vpn-connection\/"},"wordCount":162,"publisher":{"@id":"https:\/\/www.busted.dk\/blog\/#\/schema\/person\/6f1b95dddb508da8b018577701c33c9d"},"image":{"@id":"https:\/\/www.busted.dk\/blog\/automatic-set-register-this-connections-addresses-in-dns-for-a-vpn-connection\/#primaryimage"},"thumbnailUrl":"https:\/\/www.busted.dk\/blog\/wp-content\/uploads\/2019\/03\/DNS2-1.jpg","keywords":["DNS","VPN"],"articleSection":{"0":"Network","2":"VPN"},"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.busted.dk\/blog\/automatic-set-register-this-connections-addresses-in-dns-for-a-vpn-connection\/","url":"https:\/\/www.busted.dk\/blog\/automatic-set-register-this-connections-addresses-in-dns-for-a-vpn-connection\/","name":"Automatic set \"Register this connection\u2019s addresses in DNS\" for a VPN connection - Peter Busted","isPartOf":{"@id":"https:\/\/www.busted.dk\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.busted.dk\/blog\/automatic-set-register-this-connections-addresses-in-dns-for-a-vpn-connection\/#primaryimage"},"image":{"@id":"https:\/\/www.busted.dk\/blog\/automatic-set-register-this-connections-addresses-in-dns-for-a-vpn-connection\/#primaryimage"},"thumbnailUrl":"https:\/\/www.busted.dk\/blog\/wp-content\/uploads\/2019\/03\/DNS2-1.jpg","datePublished":"2019-03-15T10:21:59+00:00","dateModified":"2025-03-11T11:28:54+00:00","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.busted.dk\/blog\/automatic-set-register-this-connections-addresses-in-dns-for-a-vpn-connection\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.busted.dk\/blog\/automatic-set-register-this-connections-addresses-in-dns-for-a-vpn-connection\/#primaryimage","url":"https:\/\/www.busted.dk\/blog\/wp-content\/uploads\/2019\/03\/DNS2-1.jpg","contentUrl":"https:\/\/www.busted.dk\/blog\/wp-content\/uploads\/2019\/03\/DNS2-1.jpg","width":394,"height":483},{"@type":"WebSite","@id":"https:\/\/www.busted.dk\/blog\/#website","url":"https:\/\/www.busted.dk\/blog\/","name":"Peter Busted","description":"A blog about my daily work with tech and more, running since 2008","publisher":{"@id":"https:\/\/www.busted.dk\/blog\/#\/schema\/person\/6f1b95dddb508da8b018577701c33c9d"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.busted.dk\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.busted.dk\/blog\/#\/schema\/person\/6f1b95dddb508da8b018577701c33c9d","name":"Peter","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.busted.dk\/blog\/wp-content\/uploads\/2025\/03\/cropped-f819f80c-bdd3-4653-87cc-89c692229010.webp","url":"https:\/\/www.busted.dk\/blog\/wp-content\/uploads\/2025\/03\/cropped-f819f80c-bdd3-4653-87cc-89c692229010.webp","contentUrl":"https:\/\/www.busted.dk\/blog\/wp-content\/uploads\/2025\/03\/cropped-f819f80c-bdd3-4653-87cc-89c692229010.webp","width":1790,"height":357,"caption":"Peter"},"logo":{"@id":"https:\/\/www.busted.dk\/blog\/wp-content\/uploads\/2025\/03\/cropped-f819f80c-bdd3-4653-87cc-89c692229010.webp"},"url":"https:\/\/www.busted.dk\/blog\/author\/peter\/"}]}},"_links":{"self":[{"href":"https:\/\/www.busted.dk\/blog\/wp-json\/wp\/v2\/posts\/345","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.busted.dk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.busted.dk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.busted.dk\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.busted.dk\/blog\/wp-json\/wp\/v2\/comments?post=345"}],"version-history":[{"count":14,"href":"https:\/\/www.busted.dk\/blog\/wp-json\/wp\/v2\/posts\/345\/revisions"}],"predecessor-version":[{"id":375,"href":"https:\/\/www.busted.dk\/blog\/wp-json\/wp\/v2\/posts\/345\/revisions\/375"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.busted.dk\/blog\/wp-json\/wp\/v2\/media\/348"}],"wp:attachment":[{"href":"https:\/\/www.busted.dk\/blog\/wp-json\/wp\/v2\/media?parent=345"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.busted.dk\/blog\/wp-json\/wp\/v2\/categories?post=345"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.busted.dk\/blog\/wp-json\/wp\/v2\/tags?post=345"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}