{"id":4610,"date":"2017-04-18T11:28:00","date_gmt":"2017-04-18T11:28:00","guid":{"rendered":"http:\/\/www.webhosting.uk.com\/kb\/?p=4610"},"modified":"2025-11-24T12:52:36","modified_gmt":"2025-11-24T12:52:36","slug":"how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac","status":"publish","type":"post","link":"https:\/\/www.webhosting.uk.com\/kb\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\/","title":{"rendered":"How to update hosts file entry on Windows, Ubuntu and Mac"},"content":{"rendered":"\r\n\r\n\r\n<div style=\"text-align: left;\">As you probably know, a hosts file is basically a plain text file that contains a list of host names and their associated IP addresses.<\/div>\r\n<div style=\"text-align: left;\">\u00a0<\/div>\r\n<div style=\"text-align: left;\">If you want to block access to certain websites (such as advertising\/malicious hosts) or test the website before it goes live or redirect domains to local addresses, updating the hosts file will help you accomplish that.<\/div>\r\n<div style=\"text-align: left;\">\u00a0<\/div>\r\n<div style=\"text-align: left;\">In this knowledgebase, we will discuss how to update hosts file\u00a0in\u00a0Windows, Ubuntu and Mac OS.<\/div>\r\n<div style=\"text-align: left;\">\u00a0<\/div>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\" style=\"text-align: left;\"><strong>Edit hosts file in Windows\u00a0<\/strong><\/h4>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\" style=\"text-align: left;\">To Update the hosts file in Windows XP, Vista, 7, 8x, 10 you have to use the following command in the Run Line to open the file with notepad.\u00a0<\/p>\r\n<ol>\r\n<li>Press <strong>Windows<\/strong> + <strong>R<\/strong> keys to Run Line.<\/li>\r\n<li>Copy the below mentioned command and paste into the Run Line:<br \/><strong>notepad C:\\windows\\system32\\drivers\\etc\\hosts<\/strong><br \/>This is the location of hosts file in Windows\u00a0\r\n<figure class=\"wp-block-image aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4611\" src=\"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/run-line.png\" alt=\"location of hosts file\" width=\"455\" height=\"263\" srcset=\"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/run-line.png 455w, https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/run-line-300x173.png 300w, https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/run-line-60x35.png 60w, https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/run-line-150x87.png 150w\" sizes=\"auto, (max-width: 455px) 100vw, 455px\" \/><\/figure>\r\n<\/li>\r\n<li>When notepad is open you can <strong>edit<\/strong> the hosts file.<br \/>For example, we will block Facebook. To block Facebook just enter following the line after the # mark in the hosts file.<br \/><strong>0.0.0.0\u00a0\u00a0\u00a0 www.facebook.com<br \/><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/hosts-file.png\" alt=\"hosts file\" width=\"637\" height=\"414\" \/><\/strong><\/li>\r\n<li>Now you have edited your Hosts file and <strong>save<\/strong> it.<br \/><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/save-hosts-file.png\" alt=\"save file\" width=\"637\" height=\"414\" \/><\/li>\r\n<li>Now observe if we try to reach Facebook in <strong>IE browser<\/strong> we can\u2019t get to the page.<br \/><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/IE.png\" alt=\"unable to page open\" width=\"588\" height=\"380\" \/><\/li>\r\n<li>We also were not able to access it in <strong>Google Chrome<\/strong>.<br \/><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/chrome.png\" alt=\"google chrome\" width=\"512\" height=\"412\" \/><\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\" style=\"text-align: left;\"><strong>Edit Hosts file in Ubuntu<\/strong><\/h4>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\" style=\"text-align: left;\">You can change in the hosts file directly through the terminal on In Ubuntu 10.04 and most Linux distros. You can use your favored editor or even open your favorite GUI text editor. Like Windows 7x, Ubuntu\u2019s hosts file placed in the <strong>\/etc\/hosts<\/strong>, however here it is the root of the drive. In order to edit the file, you should open it as root which is why we use <strong><em>sudo<\/em><\/strong> here.<\/p>\r\n<ol>\r\n<li>We will use <strong>VIM<\/strong> for this example.<br \/>\r\n<figure class=\"wp-block-image aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"458\" class=\"wp-image-4616\" src=\"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/ubuntu11.png\" alt=\"ubuntu\" srcset=\"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/ubuntu11.png 640w, https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/ubuntu11-300x215.png 300w, https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/ubuntu11-60x43.png 60w, https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/ubuntu11-150x107.png 150w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\r\n<\/li>\r\n<li>You will see that with Ubuntu there is similarly a section for <strong>IP6<\/strong>. For most needs, you will just need to edit it the top section and ignore the IP6.<br \/><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/ubuntu2.png\" alt=\"ubuntu hosts\" width=\"494\" height=\"480\" \/><\/li>\r\n<li>Now save the file and try to open <strong>Facebook.com.<\/strong> Just like in windows we will see that we can\u2019t get to the page.<br \/><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/mozilla.jpg\" alt=\"unable to connect\" width=\"513\" height=\"361\" \/><\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\" style=\"text-align: left;\"><strong>Edit Hosts file on Mac OS X (Any version)<\/strong><\/h4>\r\n<ol>\r\n<li>In <strong>Mac OS X<\/strong>, editing the hosts file is similar to Ubuntu. Begin in terminal and use your preferred editor or even open your favorite GUI text editor, it is easier to do so from terminal.<br \/><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/Mac1.png\" alt=\"hosts file mac\" width=\"575\" height=\"334\" \/><\/li>\r\n<li>The file will look like a <strong>Windows<\/strong>, simply with a little less explanation. Again we are going to redirect Facebook.<br \/><a href=\"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/Snag_1d39cdc.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-19892 size-full\" src=\"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/Snag_1d39cdc.png\" alt=\"terminal\" width=\"577\" height=\"353\" srcset=\"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/Snag_1d39cdc.png 577w, https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/Snag_1d39cdc-300x184.png 300w\" sizes=\"auto, (max-width: 577px) 100vw, 577px\" \/><\/a><\/li>\r\n<li>This time it looks like that 0.0.0.0 is a <strong>loopback<\/strong> and will redirect you to the PCs Apache test page.<br \/><a href=\"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/Snag_1d3e520.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-19893 size-full\" src=\"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/Snag_1d3e520.png\" alt=\"facebook\r\n\" width=\"455\" height=\"334\" srcset=\"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/Snag_1d3e520.png 455w, https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/Snag_1d3e520-300x220.png 300w\" sizes=\"auto, (max-width: 455px) 100vw, 455px\" \/><\/a><\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<h3 style=\"text-align: left;\">Conclusion\u00a0<\/h3>\r\n<div style=\"text-align: left;\">As we have seen above, the process of updating the hosts file on Windows, Ubuntu and Mac is the same. You need to open the file and add a new line with the IP address and domain name you want to map. Remember, incorrect changes to the hosts file can cause problems with your system&#8217;s network connectivity. So it is very important to make changes carefully.<\/div>\r\n<div style=\"text-align: left;\">\u00a0<\/div>\r\n<div style=\"text-align: left;\">Also Read : <a href=\"https:\/\/www.webhosting.uk.com\/kb\/how-to-edit-your-hosts-file\/\">Disable the hosts file entries<\/a>\u00a0<\/div>\r\n<div style=\"text-align: left;\">\u00a0<\/div>\r\n","protected":false},"excerpt":{"rendered":"<p>As you probably know, a hosts file is basically a plain text file that contains a list of host names and their associated IP addresses. \u00a0 If you want to&hellip;<\/p>\n<p><a href=\"https:\/\/www.webhosting.uk.com\/kb\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\/\" class=\"more-link\">Read More<\/a><\/p>\n<div class='heateorSssClear'><\/div><div  class='heateor_sss_sharing_container heateor_sss_horizontal_sharing' data-heateor-sss-href='https:\/\/www.webhosting.uk.com\/kb\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\/'><div class='heateor_sss_sharing_title' style=\"font-weight:bold\" >Spread the love<\/div><div class=\"heateor_sss_sharing_ul\"><a aria-label=\"Facebook\" class=\"heateor_sss_facebook\" href=\"https:\/\/www.facebook.com\/sharer\/sharer.php?u=https%3A%2F%2Fwww.webhosting.uk.com%2Fkb%2Fhow-to-update-hosts-file-entry-on-windows-ubuntu-and-mac%2F\" title=\"Facebook\" rel=\"nofollow noopener\" target=\"_blank\" style=\"font-size:32px!important;box-shadow:none;display:inline-block;vertical-align:middle\"><span class=\"heateor_sss_svg\" style=\"background-color:#0765FE;width:40px;height:40px;display:inline-block;opacity:1;float:left;font-size:32px;box-shadow:none;display:inline-block;font-size:16px;padding:0 4px;vertical-align:middle;background-repeat:repeat;overflow:hidden;padding:0;cursor:pointer;box-sizing:content-box\"><svg style=\"display:block;\" focusable=\"false\" aria-hidden=\"true\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"100%\" height=\"100%\" viewBox=\"0 0 32 32\"><path fill=\"#fff\" d=\"M28 16c0-6.627-5.373-12-12-12S4 9.373 4 16c0 5.628 3.875 10.35 9.101 11.647v-7.98h-2.474V16H13.1v-1.58c0-4.085 1.849-5.978 5.859-5.978.76 0 2.072.15 2.608.298v3.325c-.283-.03-.775-.045-1.386-.045-1.967 0-2.728.745-2.728 2.683V16h3.92l-.673 3.667h-3.247v8.245C23.395 27.195 28 22.135 28 16Z\"><\/path><\/svg><\/span><\/a><a aria-label=\"X\" class=\"heateor_sss_button_x\" href=\"https:\/\/twitter.com\/intent\/tweet?text=How%20to%20Update%20Hosts%20File%20Entry%20on%20Windows%2C%20Ubuntu%2C%20and%20Mac&url=https%3A%2F%2Fwww.webhosting.uk.com%2Fkb%2Fhow-to-update-hosts-file-entry-on-windows-ubuntu-and-mac%2F\" title=\"X\" rel=\"nofollow noopener\" target=\"_blank\" style=\"font-size:32px!important;box-shadow:none;display:inline-block;vertical-align:middle\"><span class=\"heateor_sss_svg heateor_sss_s__default heateor_sss_s_x\" style=\"background-color:#2a2a2a;width:40px;height:40px;display:inline-block;opacity:1;float:left;font-size:32px;box-shadow:none;display:inline-block;font-size:16px;padding:0 4px;vertical-align:middle;background-repeat:repeat;overflow:hidden;padding:0;cursor:pointer;box-sizing:content-box\"><svg width=\"100%\" height=\"100%\" style=\"display:block;\" focusable=\"false\" aria-hidden=\"true\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 32 32\"><path fill=\"#fff\" d=\"M21.751 7h3.067l-6.7 7.658L26 25.078h-6.172l-4.833-6.32-5.531 6.32h-3.07l7.167-8.19L6 7h6.328l4.37 5.777L21.75 7Zm-1.076 16.242h1.7L11.404 8.74H9.58l11.094 14.503Z\"><\/path><\/svg><\/span><\/a><a aria-label=\"Linkedin\" class=\"heateor_sss_button_linkedin\" href=\"https:\/\/www.linkedin.com\/sharing\/share-offsite\/?url=https%3A%2F%2Fwww.webhosting.uk.com%2Fkb%2Fhow-to-update-hosts-file-entry-on-windows-ubuntu-and-mac%2F\" title=\"Linkedin\" rel=\"nofollow noopener\" target=\"_blank\" style=\"font-size:32px!important;box-shadow:none;display:inline-block;vertical-align:middle\"><span class=\"heateor_sss_svg heateor_sss_s__default heateor_sss_s_linkedin\" style=\"background-color:#0077b5;width:40px;height:40px;display:inline-block;opacity:1;float:left;font-size:32px;box-shadow:none;display:inline-block;font-size:16px;padding:0 4px;vertical-align:middle;background-repeat:repeat;overflow:hidden;padding:0;cursor:pointer;box-sizing:content-box\"><svg style=\"display:block;\" focusable=\"false\" aria-hidden=\"true\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"100%\" height=\"100%\" viewBox=\"0 0 32 32\"><path d=\"M6.227 12.61h4.19v13.48h-4.19V12.61zm2.095-6.7a2.43 2.43 0 0 1 0 4.86c-1.344 0-2.428-1.09-2.428-2.43s1.084-2.43 2.428-2.43m4.72 6.7h4.02v1.84h.058c.56-1.058 1.927-2.176 3.965-2.176 4.238 0 5.02 2.792 5.02 6.42v7.395h-4.183v-6.56c0-1.564-.03-3.574-2.178-3.574-2.18 0-2.514 1.7-2.514 3.46v6.668h-4.187V12.61z\" fill=\"#fff\"><\/path><\/svg><\/span><\/a><\/div><div class=\"heateorSssClear\"><\/div><\/div><div class='heateorSssClear'><\/div>","protected":false},"author":28,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1853],"tags":[841,843,842,311],"class_list":["post-4610","post","type-post","status-publish","format-standard","hentry","category-howto-guide","tag-hosts-file-entry","tag-mac","tag-ubuntu","tag-windows"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.9 (Yoast SEO v27.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Update Hosts File Entry on Windows, Ubuntu, and Mac<\/title>\n<meta name=\"description\" content=\"Explore a detailed guide on updating hosts file entry for Windows, Ubuntu, and Mac. Enhance your network configuration.\" \/>\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.webhosting.uk.com\/kb\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Update Hosts File Entry on Windows, Ubuntu, and Mac\" \/>\n<meta property=\"og:description\" content=\"Explore a detailed guide on updating hosts file entry for Windows, Ubuntu, and Mac. Enhance your network configuration.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webhosting.uk.com\/kb\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\/\" \/>\n<meta property=\"og:site_name\" content=\"Webhosting UK Knowledge Base\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webhostingukcom\" \/>\n<meta property=\"article:published_time\" content=\"2017-04-18T11:28:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-24T12:52:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/run-line.png\" \/>\n\t<meta property=\"og:image:width\" content=\"455\" \/>\n\t<meta property=\"og:image:height\" content=\"263\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Victor G\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"How to Update Hosts File Entry on Windows, Ubuntu, and Mac\" \/>\n<meta name=\"twitter:creator\" content=\"@WebhostingUKcom\" \/>\n<meta name=\"twitter:site\" content=\"@WebhostingUKcom\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\\\/\"},\"author\":{\"name\":\"Victor G\",\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/#\\\/schema\\\/person\\\/ea067684eae84c2b8b49a81c69407297\"},\"headline\":\"How to update hosts file entry on Windows, Ubuntu and Mac\",\"datePublished\":\"2017-04-18T11:28:00+00:00\",\"dateModified\":\"2025-11-24T12:52:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\\\/\"},\"wordCount\":527,\"publisher\":{\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/wp-content\\\/uploads\\\/2017\\\/04\\\/run-line.png\",\"keywords\":[\"Hosts File Entry\",\"Mac\",\"Ubuntu\",\"windows\"],\"articleSection\":[\"How-to Guide\"],\"inLanguage\":\"en-GB\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\\\/\",\"url\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\\\/\",\"name\":\"How to Update Hosts File Entry on Windows, Ubuntu, and Mac\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/wp-content\\\/uploads\\\/2017\\\/04\\\/run-line.png\",\"datePublished\":\"2017-04-18T11:28:00+00:00\",\"dateModified\":\"2025-11-24T12:52:36+00:00\",\"description\":\"Explore a detailed guide on updating hosts file entry for Windows, Ubuntu, and Mac. Enhance your network configuration.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/wp-content\\\/uploads\\\/2017\\\/04\\\/run-line.png\",\"contentUrl\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/wp-content\\\/uploads\\\/2017\\\/04\\\/run-line.png\",\"width\":455,\"height\":263,\"caption\":\"run line\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to update hosts file entry on Windows, Ubuntu and Mac\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/\",\"name\":\"Webhosting UK Knowledge Base\",\"description\":\"Expert Insights on Hosting, Development, Security, Marketing, and SEO\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/#organization\"},\"alternateName\":\"WHUK\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/#organization\",\"name\":\"Webhosting UK\",\"alternateName\":\"WHUK\",\"url\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/WHUK-logo-1.png\",\"contentUrl\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/WHUK-logo-1.png\",\"width\":1200,\"height\":628,\"caption\":\"Webhosting UK\"},\"image\":{\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/webhostingukcom\",\"https:\\\/\\\/x.com\\\/WebhostingUKcom\",\"https:\\\/\\\/www.youtube.com\\\/c\\\/webhostinguk\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/webhosting-uk-com-ltd\\\/\",\"https:\\\/\\\/www.instagram.com\\\/webhosting_uk\\\/\",\"https:\\\/\\\/www.tiktok.com\\\/@webhostinguk\"],\"description\":\"Fast, reliable, and cost-effective website hosting services with Webhosting UK. Committed to providing you secure support around the clock.\",\"email\":\"sales@webhosting.uk.com\",\"telephone\":\"0800 862 0890\",\"legalName\":\"Webhosting UK\",\"foundingDate\":\"2001-02-07\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"51\",\"maxValue\":\"200\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/#\\\/schema\\\/person\\\/ea067684eae84c2b8b49a81c69407297\",\"name\":\"Victor G\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9bf0713adcbaded4878508c93d93927ecbfa4f74548fd9bcee41478d8768bd66?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9bf0713adcbaded4878508c93d93927ecbfa4f74548fd9bcee41478d8768bd66?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9bf0713adcbaded4878508c93d93927ecbfa4f74548fd9bcee41478d8768bd66?s=96&d=mm&r=g\",\"caption\":\"Victor G\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Update Hosts File Entry on Windows, Ubuntu, and Mac","description":"Explore a detailed guide on updating hosts file entry for Windows, Ubuntu, and Mac. Enhance your network configuration.","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.webhosting.uk.com\/kb\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\/","og_locale":"en_GB","og_type":"article","og_title":"How to Update Hosts File Entry on Windows, Ubuntu, and Mac","og_description":"Explore a detailed guide on updating hosts file entry for Windows, Ubuntu, and Mac. Enhance your network configuration.","og_url":"https:\/\/www.webhosting.uk.com\/kb\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\/","og_site_name":"Webhosting UK Knowledge Base","article_publisher":"https:\/\/www.facebook.com\/webhostingukcom","article_published_time":"2017-04-18T11:28:00+00:00","article_modified_time":"2025-11-24T12:52:36+00:00","og_image":[{"width":455,"height":263,"url":"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/run-line.png","type":"image\/png"}],"author":"Victor G","twitter_card":"summary_large_image","twitter_title":"How to Update Hosts File Entry on Windows, Ubuntu, and Mac","twitter_creator":"@WebhostingUKcom","twitter_site":"@WebhostingUKcom","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webhosting.uk.com\/kb\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\/#article","isPartOf":{"@id":"https:\/\/www.webhosting.uk.com\/kb\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\/"},"author":{"name":"Victor G","@id":"https:\/\/www.webhosting.uk.com\/kb\/#\/schema\/person\/ea067684eae84c2b8b49a81c69407297"},"headline":"How to update hosts file entry on Windows, Ubuntu and Mac","datePublished":"2017-04-18T11:28:00+00:00","dateModified":"2025-11-24T12:52:36+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webhosting.uk.com\/kb\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\/"},"wordCount":527,"publisher":{"@id":"https:\/\/www.webhosting.uk.com\/kb\/#organization"},"image":{"@id":"https:\/\/www.webhosting.uk.com\/kb\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/run-line.png","keywords":["Hosts File Entry","Mac","Ubuntu","windows"],"articleSection":["How-to Guide"],"inLanguage":"en-GB"},{"@type":"WebPage","@id":"https:\/\/www.webhosting.uk.com\/kb\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\/","url":"https:\/\/www.webhosting.uk.com\/kb\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\/","name":"How to Update Hosts File Entry on Windows, Ubuntu, and Mac","isPartOf":{"@id":"https:\/\/www.webhosting.uk.com\/kb\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webhosting.uk.com\/kb\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\/#primaryimage"},"image":{"@id":"https:\/\/www.webhosting.uk.com\/kb\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/run-line.png","datePublished":"2017-04-18T11:28:00+00:00","dateModified":"2025-11-24T12:52:36+00:00","description":"Explore a detailed guide on updating hosts file entry for Windows, Ubuntu, and Mac. Enhance your network configuration.","breadcrumb":{"@id":"https:\/\/www.webhosting.uk.com\/kb\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webhosting.uk.com\/kb\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.webhosting.uk.com\/kb\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\/#primaryimage","url":"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/run-line.png","contentUrl":"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2017\/04\/run-line.png","width":455,"height":263,"caption":"run line"},{"@type":"BreadcrumbList","@id":"https:\/\/www.webhosting.uk.com\/kb\/how-to-update-hosts-file-entry-on-windows-ubuntu-and-mac\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webhosting.uk.com\/kb\/"},{"@type":"ListItem","position":2,"name":"How to update hosts file entry on Windows, Ubuntu and Mac"}]},{"@type":"WebSite","@id":"https:\/\/www.webhosting.uk.com\/kb\/#website","url":"https:\/\/www.webhosting.uk.com\/kb\/","name":"Webhosting UK Knowledge Base","description":"Expert Insights on Hosting, Development, Security, Marketing, and SEO","publisher":{"@id":"https:\/\/www.webhosting.uk.com\/kb\/#organization"},"alternateName":"WHUK","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webhosting.uk.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/www.webhosting.uk.com\/kb\/#organization","name":"Webhosting UK","alternateName":"WHUK","url":"https:\/\/www.webhosting.uk.com\/kb\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.webhosting.uk.com\/kb\/#\/schema\/logo\/image\/","url":"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2023\/08\/WHUK-logo-1.png","contentUrl":"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2023\/08\/WHUK-logo-1.png","width":1200,"height":628,"caption":"Webhosting UK"},"image":{"@id":"https:\/\/www.webhosting.uk.com\/kb\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webhostingukcom","https:\/\/x.com\/WebhostingUKcom","https:\/\/www.youtube.com\/c\/webhostinguk","https:\/\/www.linkedin.com\/company\/webhosting-uk-com-ltd\/","https:\/\/www.instagram.com\/webhosting_uk\/","https:\/\/www.tiktok.com\/@webhostinguk"],"description":"Fast, reliable, and cost-effective website hosting services with Webhosting UK. Committed to providing you secure support around the clock.","email":"sales@webhosting.uk.com","telephone":"0800 862 0890","legalName":"Webhosting UK","foundingDate":"2001-02-07","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"51","maxValue":"200"}},{"@type":"Person","@id":"https:\/\/www.webhosting.uk.com\/kb\/#\/schema\/person\/ea067684eae84c2b8b49a81c69407297","name":"Victor G","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/secure.gravatar.com\/avatar\/9bf0713adcbaded4878508c93d93927ecbfa4f74548fd9bcee41478d8768bd66?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/9bf0713adcbaded4878508c93d93927ecbfa4f74548fd9bcee41478d8768bd66?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9bf0713adcbaded4878508c93d93927ecbfa4f74548fd9bcee41478d8768bd66?s=96&d=mm&r=g","caption":"Victor G"}}]}},"_links":{"self":[{"href":"https:\/\/www.webhosting.uk.com\/kb\/wp-json\/wp\/v2\/posts\/4610","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webhosting.uk.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webhosting.uk.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webhosting.uk.com\/kb\/wp-json\/wp\/v2\/users\/28"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webhosting.uk.com\/kb\/wp-json\/wp\/v2\/comments?post=4610"}],"version-history":[{"count":18,"href":"https:\/\/www.webhosting.uk.com\/kb\/wp-json\/wp\/v2\/posts\/4610\/revisions"}],"predecessor-version":[{"id":20026,"href":"https:\/\/www.webhosting.uk.com\/kb\/wp-json\/wp\/v2\/posts\/4610\/revisions\/20026"}],"wp:attachment":[{"href":"https:\/\/www.webhosting.uk.com\/kb\/wp-json\/wp\/v2\/media?parent=4610"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webhosting.uk.com\/kb\/wp-json\/wp\/v2\/categories?post=4610"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webhosting.uk.com\/kb\/wp-json\/wp\/v2\/tags?post=4610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}