{"id":139,"date":"2025-09-18T00:00:27","date_gmt":"2025-09-18T00:00:27","guid":{"rendered":"https:\/\/bodhost.com\/kb\/\/web-hosting\/?p=139"},"modified":"2026-02-26T14:02:06","modified_gmt":"2026-02-26T14:02:06","slug":"change-default-ip-address-for-namebased-sites","status":"publish","type":"post","link":"https:\/\/www.bodhost.com\/kb\/change-default-ip-address-for-namebased-sites\/","title":{"rendered":"Change Default IP Address for Name-based Sites"},"content":{"rendered":"\r\n<p class=\"wp-block-paragraph\" data-start=\"370\" data-end=\"734\">When you\u2019re hosting multiple websites on the same server using name-based virtual hosting, your server needs to map each site to an IP address. By default, Apache assigns the first IP available, but sometimes you may want to change the default IP address for name-based sites, maybe due to SSL requirements, DNS changes, or server configuration updates.<\/p>\r\n<h2 data-start=\"370\" data-end=\"734\">What Are Name-Based Sites?<\/h2>\r\n<p data-start=\"892\" data-end=\"1054\">Name-based hosting allows multiple websites to share a single IP address. The web server uses the domain name in the HTTP request to decide which site to serve.<\/p>\r\n<ul data-start=\"1056\" data-end=\"1203\">\r\n<li data-start=\"1056\" data-end=\"1105\">\r\n<p data-start=\"1058\" data-end=\"1105\">Saves IP addresses when hosting many domains.<\/p>\r\n<\/li>\r\n<li data-start=\"1106\" data-end=\"1149\">\r\n<p data-start=\"1108\" data-end=\"1149\">Useful for shared hosting environments.<\/p>\r\n<\/li>\r\n<li data-start=\"1150\" data-end=\"1203\">\r\n<p data-start=\"1152\" data-end=\"1203\">Easy to manage multiple websites from one server.<\/p>\r\n<\/li>\r\n<\/ul>\r\n<h3>Steps to Change Default IP Address for Name-Based Sites<\/h3>\r\n<p data-start=\"736\" data-end=\"852\">This guide explains the step-by-step process to update the default IP address for name-based sites on your server.<\/p>\r\n<h4>1. Edit the Virtual Hosting Configuration<\/h4>\r\n<p>Open the name-based IP address configuration file:<\/p>\r\n<p>nano \/etc\/virtualhosting\/namebased_ip_addrs<\/p>\r\n<p>Update the IP address to your desired new IP.<\/p>\r\n<h4>2. Update the Hosts File<\/h4>\r\n<p>Edit the &#8220;\/etc\/hosts&#8221; file and add or update the entries for your domains with the new IP address.<\/p>\r\n<h4>3. Modify Apache Configuration<\/h4>\r\n<p>Open the Apache configuration file:<\/p>\r\n<p>&#8220;nano \/etc\/httpd\/conf\/httpd.conf&#8221;<\/p>\r\n<p>Search for NameVirtualHost and update the IP accordingly.<\/p>\r\n<h4>4. Update Application Config File<\/h4>\r\n<p>If you are using a CMS like WordPress with phpMyAdmin, update the configuration file:<\/p>\r\n<p>&#8220;nano \/var\/www\/html\/MyAdmin\/wp.config.inc.php&#8221;<\/p>\r\n<h4>5. Update IP Detection File<\/h4>\r\n<p>Edit the file that detects IP changes:<\/p>\r\n<p>&#8220;nano \/etc\/detectchanges\/IP&#8221;<\/p>\r\n<h4>6. Run NBDetectChanges<\/h4>\r\n<p>After making changes, run the following command to detect and apply updates:<\/p>\r\n<p>&#8220;\/usr\/local\/bin\/NBDetectchanges&#8221;<\/p>\r\n<h4>7. Resave All Sites<\/h4>\r\n<p>Finally, resave all the name-based sites to ensure changes are applied.<\/p>\r\n<p>&nbsp;<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>When you\u2019re hosting multiple websites on the same server using name-based virtual hosting, your server needs to map each site to an IP address. By default, Apache assigns the first&hellip;<\/p>\n<p><a href=\"https:\/\/www.bodhost.com\/kb\/change-default-ip-address-for-namebased-sites\/\" class=\"more-link\">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":[666],"tags":[1185,775,1186],"class_list":["post-139","post","type-post","status-publish","format-standard","hentry","category-general","tag-change-default-ip-address","tag-ip-address","tag-name-based-sites"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Change Default IP Address for Name-Based Sites | Quick Guide<\/title>\n<meta name=\"description\" content=\"How to change the default IP address for name-based sites in Linux. Quick guide covering Apache, hosts file, and NBDetectchanges command.\" \/>\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.bodhost.com\/kb\/change-default-ip-address-for-namebased-sites\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Change Default IP Address for Name-Based Sites | Quick Guide\" \/>\n<meta property=\"og:description\" content=\"How to change the default IP address for name-based sites in Linux. Quick guide covering Apache, hosts file, and NBDetectchanges command.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.bodhost.com\/kb\/change-default-ip-address-for-namebased-sites\/\" \/>\n<meta property=\"og:site_name\" content=\"Knowledge Base - bodHOST\" \/>\n<meta property=\"article:published_time\" content=\"2025-09-18T00:00:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-26T14:02:06+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/change-default-ip-address-for-namebased-sites\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/change-default-ip-address-for-namebased-sites\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/c48414ad1536cea20e85282b0737a9f9\"},\"headline\":\"Change Default IP Address for Name-based Sites\",\"datePublished\":\"2025-09-18T00:00:27+00:00\",\"dateModified\":\"2026-02-26T14:02:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/change-default-ip-address-for-namebased-sites\\\/\"},\"wordCount\":291,\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"keywords\":[\"Change Default IP Address\",\"IP address\",\"Name-based Sites\"],\"articleSection\":[\"General Discussion\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/change-default-ip-address-for-namebased-sites\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/change-default-ip-address-for-namebased-sites\\\/\",\"name\":\"Change Default IP Address for Name-Based Sites | Quick Guide\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\"},\"datePublished\":\"2025-09-18T00:00:27+00:00\",\"dateModified\":\"2026-02-26T14:02:06+00:00\",\"description\":\"How to change the default IP address for name-based sites in Linux. Quick guide covering Apache, hosts file, and NBDetectchanges command.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/change-default-ip-address-for-namebased-sites\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/change-default-ip-address-for-namebased-sites\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/change-default-ip-address-for-namebased-sites\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"General Discussion\",\"item\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/category\\\/general\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Change Default IP Address for Name-based Sites\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"alternateName\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"contentUrl\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"width\":240,\"height\":240,\"caption\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\"},\"image\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/c48414ad1536cea20e85282b0737a9f9\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51e53199212db3f59606920448d45a6ead224f904558e3ab9251d071a609b202?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51e53199212db3f59606920448d45a6ead224f904558e3ab9251d071a609b202?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51e53199212db3f59606920448d45a6ead224f904558e3ab9251d071a609b202?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Change Default IP Address for Name-Based Sites | Quick Guide","description":"How to change the default IP address for name-based sites in Linux. Quick guide covering Apache, hosts file, and NBDetectchanges command.","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.bodhost.com\/kb\/change-default-ip-address-for-namebased-sites\/","og_locale":"en_US","og_type":"article","og_title":"Change Default IP Address for Name-Based Sites | Quick Guide","og_description":"How to change the default IP address for name-based sites in Linux. Quick guide covering Apache, hosts file, and NBDetectchanges command.","og_url":"https:\/\/www.bodhost.com\/kb\/change-default-ip-address-for-namebased-sites\/","og_site_name":"Knowledge Base - bodHOST","article_published_time":"2025-09-18T00:00:27+00:00","article_modified_time":"2026-02-26T14:02:06+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.bodhost.com\/kb\/change-default-ip-address-for-namebased-sites\/#article","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/change-default-ip-address-for-namebased-sites\/"},"author":{"name":"admin","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/c48414ad1536cea20e85282b0737a9f9"},"headline":"Change Default IP Address for Name-based Sites","datePublished":"2025-09-18T00:00:27+00:00","dateModified":"2026-02-26T14:02:06+00:00","mainEntityOfPage":{"@id":"https:\/\/www.bodhost.com\/kb\/change-default-ip-address-for-namebased-sites\/"},"wordCount":291,"publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"keywords":["Change Default IP Address","IP address","Name-based Sites"],"articleSection":["General Discussion"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.bodhost.com\/kb\/change-default-ip-address-for-namebased-sites\/","url":"https:\/\/www.bodhost.com\/kb\/change-default-ip-address-for-namebased-sites\/","name":"Change Default IP Address for Name-Based Sites | Quick Guide","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/#website"},"datePublished":"2025-09-18T00:00:27+00:00","dateModified":"2026-02-26T14:02:06+00:00","description":"How to change the default IP address for name-based sites in Linux. Quick guide covering Apache, hosts file, and NBDetectchanges command.","breadcrumb":{"@id":"https:\/\/www.bodhost.com\/kb\/change-default-ip-address-for-namebased-sites\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.bodhost.com\/kb\/change-default-ip-address-for-namebased-sites\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.bodhost.com\/kb\/change-default-ip-address-for-namebased-sites\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"General Discussion","item":"https:\/\/www.bodhost.com\/kb\/category\/general\/"},{"@type":"ListItem","position":2,"name":"Change Default IP Address for Name-based Sites"}]},{"@type":"WebSite","@id":"https:\/\/www.bodhost.com\/kb\/#website","url":"https:\/\/www.bodhost.com\/kb\/","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","description":"","publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"alternateName":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.bodhost.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.bodhost.com\/kb\/#organization","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","url":"https:\/\/www.bodhost.com\/kb\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/","url":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","contentUrl":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","width":240,"height":240,"caption":"Web Hosting Knowledge Base | bodHOST Hosting FAQ"},"image":{"@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/c48414ad1536cea20e85282b0737a9f9","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/51e53199212db3f59606920448d45a6ead224f904558e3ab9251d071a609b202?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/51e53199212db3f59606920448d45a6ead224f904558e3ab9251d071a609b202?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/51e53199212db3f59606920448d45a6ead224f904558e3ab9251d071a609b202?s=96&d=mm&r=g","caption":"admin"},"url":"https:\/\/www.bodhost.com\/kb\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/comments?post=139"}],"version-history":[{"count":5,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/139\/revisions"}],"predecessor-version":[{"id":14579,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/139\/revisions\/14579"}],"wp:attachment":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/media?parent=139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/categories?post=139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/tags?post=139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}