{"id":20401,"date":"2022-11-09T14:52:04","date_gmt":"2022-11-09T09:22:04","guid":{"rendered":"https:\/\/jassweb.com\/solved\/solved-how-do-i-set-up-local-bind-server-for-dev-machine-to-map-to-vhosts-on-server\/"},"modified":"2022-11-09T14:52:04","modified_gmt":"2022-11-09T09:22:04","slug":"solved-how-do-i-set-up-local-bind-server-for-dev-machine-to-map-to-vhosts-on-server","status":"publish","type":"post","link":"https:\/\/jassweb.com\/solved\/solved-how-do-i-set-up-local-bind-server-for-dev-machine-to-map-to-vhosts-on-server\/","title":{"rendered":"[Solved] how do i set up local bind server for dev machine to map to vhosts on server"},"content":{"rendered":"<p> [ad_1]<br \/>\n<\/p>\n<div id=\"answer-29889810\" class=\"answer js-answer accepted-answer js-accepted-answer\" data-answerid=\"29889810\" data-parentid=\"29873260\" data-score=\"1\" data-position-on-page=\"1\" data-highest-scored=\"1\" data-question-has-accepted-highest-score=\"1\" itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n<div class=\"post-layout\">\n<div class=\"votecell post-layout--left\"><\/div>\n<div class=\"answercell post-layout--right\">\n<div class=\"s-prose js-post-body\" itemprop=\"text\">\n<p>To get bind working correctly, there are some rules to follow to get it configured correctly.<\/p>\n<p>You need to choose a domain, add the zone record for it, adding only one entry for the hostname inside this zone record, at the top, otherwise all mentions are the domain only. <\/p>\n<p>It&#8217;s good habit to end all domain names in a dot, in the config file, e.g. domain.com.<\/p>\n<p>The NS name, can be the domain name.<\/p>\n<p>The A record can be the ip of the machine, not localhost, since other machines in your network will pull this ip specified.<\/p>\n<p>Once you have your a record, you can go hog wild adding your domain names, or you can wildcard it, which is what I did. So now all domains ending in the domain I chose map to the web development stuff.<\/p>\n<p>The DNS settings in the IP properties of the adapter on the machine you want to use the DNS services, i.e. the client, you want to set the DNS to the lan ip of the DNS server.  <\/p>\n<p>Only adjustments needed are \/etc\/named.conf, \/var\/named\/ld.pvt.zone, and the IP properties as I mentioned just above. <\/p>\n<p>Here are the config files, enjoy!<\/p>\n<h1>\/etc\/named.conf<\/h1>\n<pre><code>\/\/ vim:set ts=4 sw=4 et:\n\nacl \"trusted\" {\n        192.168.1.0\/24;\n        127.0.0.0\/8;\n};\n\noptions {\n    directory \"\/var\/named\";\n    pid-file \"\/run\/named\/named.pid\";\n    listen-on { trusted; };\n    listen-on-v6 { any; };\n    allow-query { trusted; };\n    allow-transfer { none; };\n    allow-update { none; };\n    forwarders {\n        8.8.4.4;\n        8.8.8.8;\n    };\n    query-source address * port 53;\n    version none;\n    hostname none;\n    server-id none;\n};\n\nlogging {\n    channel default_file {\n        file \"\/var\/log\/named\/default.log\" versions 3 size 5m;\n        severity dynamic;\n        print-time yes;\n    };\n    channel general_file {\n        file \"\/var\/log\/named\/general.log\" versions 3 size 5m;\n        severity dynamic;\n        print-time yes;\n    };\n    channel database_file {\n        file \"\/var\/log\/named\/database.log\" versions 3 size 5m;\n        severity dynamic;\n        print-time yes;\n    };\n    channel security_file {\n        file \"\/var\/log\/named\/security.log\" versions 3 size 5m;\n        severity dynamic;\n        print-time yes;\n    };\nchannel config_file {\n        file \"\/var\/log\/named\/config.log\" versions 3 size 5m;\n        severity dynamic;\n        print-time yes;\n    };\n    channel resolver_file {\n        file \"\/var\/log\/named\/resolver.log\" versions 3 size 5m;\n        severity dynamic;\n        print-time yes;\n    };\n    channel xfer-in_file {\n        file \"\/var\/log\/named\/xfer-in.log\" versions 3 size 5m;\n        severity dynamic;\n        print-time yes;\n    };\n    channel xfer-out_file {\n        file \"\/var\/log\/named\/xfer-out.log\" versions 3 size 5m;\n        severity dynamic;\n        print-time yes;\n    };\n    channel notify_file {\n        file \"\/var\/log\/named\/notify.log\" versions 3 size 5m;\n        severity dynamic;\n        print-time yes;\n    };\n    channel client_file {\n        file \"\/var\/log\/named\/client.log\" versions 3 size 5m;\n        severity dynamic;\n        print-time yes;\n    };\n    channel unmatched_file {\n        file \"\/var\/log\/named\/unmatched.log\" versions 3 size 5m;\n        severity dynamic;\n        print-time yes;\n    };\n    channel queries_file {\n        file \"\/var\/log\/named\/queries.log\" versions 3 size 5m;\n        severity dynamic;\n        print-time yes;\n    };\n    channel network_file {\n        file \"\/var\/log\/named\/network.log\" versions 3 size 5m;\n        severity dynamic;\n        print-time yes;\n    };\n    channel update_file {\n        file \"\/var\/log\/named\/update.log\" versions 3 size 5m;\n        severity dynamic;\n        print-time yes;\n    };\n    channel dispatch_file {\n        file \"\/var\/log\/named\/dispatch.log\" versions 3 size 5m;\n        severity dynamic;\n        print-time yes;\n    };\n    channel dnssec_file {\n        file \"\/var\/log\/named\/dnssec.log\" versions 3 size 5m;\n        severity dynamic;\n        print-time yes;\n    };\nchannel lame-servers_file {\n        file \"\/var\/log\/named\/lame-servers.log\" versions 3 size 5m;\n        severity dynamic;\n        print-time yes;\n    };\n    category default { default_file; };\n    category general { general_file; };\n    category database { database_file; };\n    category security { security_file; };\n    category config { config_file; };\n    category resolver { resolver_file; };\n    category xfer-in { xfer-in_file; };\n    category xfer-out { xfer-out_file; };\n    category notify { notify_file; };\n    category client { client_file; };\n    category unmatched { unmatched_file; };\n    category queries { queries_file; };\n    category network { network_file; };\n    category update { update_file; };\n    category dispatch { dispatch_file; };\n    category dnssec { dnssec_file; };\n    category lame-servers { lame-servers_file; };\n};\n\nzone \"ld.pvt\" IN {\n    type master;\n    file \"ld.pvt.zone\";\n};\n<\/code><\/pre>\n<h1>\/var\/named\/ld.pvt.zone<\/h1>\n<pre><code>$TTL 7200\n@               1D IN SOA       ld.pvt. root.ld.pvt. (\n                                        2007011622      ; Serial\n                                        3H              ; Refresh\n                                        15M             ; Retry\n                                        1W              ; Expire - 1 week\n                                        1D )            ; Minimum\n\n                IN      NS      ld.pvt.\nld.pvt.         IN      A       192.168.1.10\n*.ld.pvt.       IN      CNAME   ld.pvt.\n<\/code><\/pre>\n<p>You might need<\/p>\n<pre><code># mkdir \/var\/db\/nscd\n# touch \/etc\/netgroup\n# systemctl restart named\n<\/code><\/pre>\n<p>Use journalctl -xn to look for errors.<\/p>\n<p>Once it is running, you should be able to ping anything.ld.pvt, NOW your vhost will know what to do!<\/p>\n<p>Now on your client machine, you need to adjust the DNS, and flush dns resolver cache.<br \/>\n<code>nscd -K<\/code> then <code>nscd<\/code> or for a winbox, <code>ipconfig \/flushdns<\/code>, then try pinging on your LAN to the new anything.ld.pvt.<\/p>\n<p>To put your client box on the map, you need to add an A record, pointing to its ip, e.g.<br \/>\n<code>automated-pooper-scooper.ld.pvt. IN      A       192.168.1.44<\/code><\/p>\n<\/p><\/div>\n<div class=\"mt24\"><\/div>\n<\/div>\n<p>            <span class=\"d-none\" itemprop=\"commentCount\">1<\/span> <\/p><\/div>\n<\/div>\n<p>[ad_2]<\/p>\n<p>solved how do i set up local bind server for dev machine to map to vhosts on server <\/p>\n","protected":false},"excerpt":{"rendered":"<p>[ad_1] To get bind working correctly, there are some rules to follow to get it configured correctly. You need to choose a domain, add the zone record for it, adding only one entry for the hostname inside this zone record, at the top, otherwise all mentions are the domain only. It&#8217;s good habit to end &#8230; <a title=\"[Solved] how do i set up local bind server for dev machine to map to vhosts on server\" class=\"read-more\" href=\"https:\/\/jassweb.com\/solved\/solved-how-do-i-set-up-local-bind-server-for-dev-machine-to-map-to-vhosts-on-server\/\" aria-label=\"More on [Solved] how do i set up local bind server for dev machine to map to vhosts on server\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[320],"tags":[2222,1309,424,4768],"class_list":["post-20401","post","type-post","status-publish","format-standard","hentry","category-solved","tag-bind","tag-dns","tag-linux","tag-vhosts"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[Solved] how do i set up local bind server for dev machine to map to vhosts on server - JassWeb<\/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:\/\/jassweb.com\/solved\/solved-how-do-i-set-up-local-bind-server-for-dev-machine-to-map-to-vhosts-on-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[Solved] how do i set up local bind server for dev machine to map to vhosts on server - JassWeb\" \/>\n<meta property=\"og:description\" content=\"[ad_1] To get bind working correctly, there are some rules to follow to get it configured correctly. You need to choose a domain, add the zone record for it, adding only one entry for the hostname inside this zone record, at the top, otherwise all mentions are the domain only. It&#8217;s good habit to end ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jassweb.com\/solved\/solved-how-do-i-set-up-local-bind-server-for-dev-machine-to-map-to-vhosts-on-server\/\" \/>\n<meta property=\"og:site_name\" content=\"JassWeb\" \/>\n<meta property=\"article:published_time\" content=\"2022-11-09T09:22:04+00:00\" \/>\n<meta name=\"author\" content=\"Kirat\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kirat\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-how-do-i-set-up-local-bind-server-for-dev-machine-to-map-to-vhosts-on-server\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-how-do-i-set-up-local-bind-server-for-dev-machine-to-map-to-vhosts-on-server\/\"},\"author\":{\"name\":\"Kirat\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31\"},\"headline\":\"[Solved] how do i set up local bind server for dev machine to map to vhosts on server\",\"datePublished\":\"2022-11-09T09:22:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-how-do-i-set-up-local-bind-server-for-dev-machine-to-map-to-vhosts-on-server\/\"},\"wordCount\":337,\"publisher\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\"},\"keywords\":[\"bind\",\"dns\",\"linux\",\"vhosts\"],\"articleSection\":[\"Solved\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-how-do-i-set-up-local-bind-server-for-dev-machine-to-map-to-vhosts-on-server\/\",\"url\":\"https:\/\/jassweb.com\/solved\/solved-how-do-i-set-up-local-bind-server-for-dev-machine-to-map-to-vhosts-on-server\/\",\"name\":\"[Solved] how do i set up local bind server for dev machine to map to vhosts on server - JassWeb\",\"isPartOf\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#website\"},\"datePublished\":\"2022-11-09T09:22:04+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-how-do-i-set-up-local-bind-server-for-dev-machine-to-map-to-vhosts-on-server\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/jassweb.com\/solved\/solved-how-do-i-set-up-local-bind-server-for-dev-machine-to-map-to-vhosts-on-server\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-how-do-i-set-up-local-bind-server-for-dev-machine-to-map-to-vhosts-on-server\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/jassweb.com\/solved\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[Solved] how do i set up local bind server for dev machine to map to vhosts on server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/jassweb.com\/solved\/#website\",\"url\":\"https:\/\/jassweb.com\/solved\/\",\"name\":\"JassWeb\",\"description\":\"Build High-quality Websites\",\"publisher\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/jassweb.com\/solved\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\",\"name\":\"Jass Web\",\"url\":\"https:\/\/jassweb.com\/solved\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png\",\"contentUrl\":\"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png\",\"width\":693,\"height\":132,\"caption\":\"Jass Web\"},\"image\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31\",\"name\":\"Kirat\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750\",\"contentUrl\":\"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750\",\"caption\":\"Kirat\"},\"sameAs\":[\"http:\/\/jassweb.com\"],\"url\":\"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[Solved] how do i set up local bind server for dev machine to map to vhosts on server - JassWeb","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:\/\/jassweb.com\/solved\/solved-how-do-i-set-up-local-bind-server-for-dev-machine-to-map-to-vhosts-on-server\/","og_locale":"en_US","og_type":"article","og_title":"[Solved] how do i set up local bind server for dev machine to map to vhosts on server - JassWeb","og_description":"[ad_1] To get bind working correctly, there are some rules to follow to get it configured correctly. You need to choose a domain, add the zone record for it, adding only one entry for the hostname inside this zone record, at the top, otherwise all mentions are the domain only. It&#8217;s good habit to end ... Read more","og_url":"https:\/\/jassweb.com\/solved\/solved-how-do-i-set-up-local-bind-server-for-dev-machine-to-map-to-vhosts-on-server\/","og_site_name":"JassWeb","article_published_time":"2022-11-09T09:22:04+00:00","author":"Kirat","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kirat","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jassweb.com\/solved\/solved-how-do-i-set-up-local-bind-server-for-dev-machine-to-map-to-vhosts-on-server\/#article","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/solved-how-do-i-set-up-local-bind-server-for-dev-machine-to-map-to-vhosts-on-server\/"},"author":{"name":"Kirat","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31"},"headline":"[Solved] how do i set up local bind server for dev machine to map to vhosts on server","datePublished":"2022-11-09T09:22:04+00:00","mainEntityOfPage":{"@id":"https:\/\/jassweb.com\/solved\/solved-how-do-i-set-up-local-bind-server-for-dev-machine-to-map-to-vhosts-on-server\/"},"wordCount":337,"publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"keywords":["bind","dns","linux","vhosts"],"articleSection":["Solved"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/jassweb.com\/solved\/solved-how-do-i-set-up-local-bind-server-for-dev-machine-to-map-to-vhosts-on-server\/","url":"https:\/\/jassweb.com\/solved\/solved-how-do-i-set-up-local-bind-server-for-dev-machine-to-map-to-vhosts-on-server\/","name":"[Solved] how do i set up local bind server for dev machine to map to vhosts on server - JassWeb","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/#website"},"datePublished":"2022-11-09T09:22:04+00:00","breadcrumb":{"@id":"https:\/\/jassweb.com\/solved\/solved-how-do-i-set-up-local-bind-server-for-dev-machine-to-map-to-vhosts-on-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jassweb.com\/solved\/solved-how-do-i-set-up-local-bind-server-for-dev-machine-to-map-to-vhosts-on-server\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jassweb.com\/solved\/solved-how-do-i-set-up-local-bind-server-for-dev-machine-to-map-to-vhosts-on-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/jassweb.com\/solved\/"},{"@type":"ListItem","position":2,"name":"[Solved] how do i set up local bind server for dev machine to map to vhosts on server"}]},{"@type":"WebSite","@id":"https:\/\/jassweb.com\/solved\/#website","url":"https:\/\/jassweb.com\/solved\/","name":"JassWeb","description":"Build High-quality Websites","publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jassweb.com\/solved\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/jassweb.com\/solved\/#organization","name":"Jass Web","url":"https:\/\/jassweb.com\/solved\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/","url":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","contentUrl":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","width":693,"height":132,"caption":"Jass Web"},"image":{"@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31","name":"Kirat","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/image\/","url":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750","contentUrl":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750","caption":"Kirat"},"sameAs":["http:\/\/jassweb.com"],"url":"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/"}]}},"_links":{"self":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/20401","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/comments?post=20401"}],"version-history":[{"count":0,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/20401\/revisions"}],"wp:attachment":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/media?parent=20401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/categories?post=20401"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/tags?post=20401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}