{"id":3183,"date":"2015-11-30T07:05:30","date_gmt":"2015-11-30T07:05:30","guid":{"rendered":"https:\/\/cpanelplesk.com\/wp62\/?p=3183"},"modified":"2021-02-18T04:46:54","modified_gmt":"2021-02-18T04:46:54","slug":"how-to-edit-hosts-file-on-your-system","status":"publish","type":"post","link":"https:\/\/cpanelplesk.com\/wp62\/how-to-edit-hosts-file-on-your-system\/","title":{"rendered":"How To Edit Hosts File on Your System"},"content":{"rendered":"<p><span style=\"color: #000000;\">So often you will need to edit the hosts file on your machine. Sometimes because of an attack \u00a0and others so that you can simply and freely control access to websites and network traffic.This file is available on each operating systems and useful for mapping domains with IP address without making any DNS entry.<\/span><br \/>\n<span style=\"color: #000000;\">Using hosts file we can use any test domain name like testdomain.com, www.testdomain.com configure on server and map with\u00a0IP\u00a0in hosts file.<\/span><\/p>\n<h2 class=\"heading1\">Edit Hosts File on Linux:<\/h2>\n<p><span style=\"color: #000000;\">On Linux operating systems this file is normally available at following location:<\/span><\/p>\n<div class=\"cpanel-files\"><\/div>\n<pre class=\"lang:default decode:true \">\/etc\/hosts<\/pre>\n<div class=\"space1\"><\/div>\n<p><span style=\"color: #000000;\">Now we will edit\u00a0this file and make proper entry with\u00a0<a href=\"https:\/\/cpanelplesk.com\/wp62\/how-to-set-hostname-on-centos\/\">hostname<\/a>\u00a0and ip address as\u00a0follows:<\/span><\/p>\n<div class=\"cpanel-files\"><\/div>\n<pre class=\"lang:default decode:true \">nano \/etc\/hosts<\/pre>\n<div class=\"space1\"><\/div>\n<div class=\"cpanel-files\"><\/div>\n<pre class=\"lang:default decode:true \">127.0.0.1   localhost.localdomain   localhost\r\n::1         localhost6.localdomain6 localhost6\r\n\r\n192.168.1.100     testdomain.com\r\n192.168.1.100     www.testdomain.com\r\n10.10.0.11        site1.testdomain.com site2.testdomain.com<\/pre>\n<div class=\"space1\"><\/div>\n<p><span style=\"color: #000000;\">Save file and close it.\u00a0<\/span><\/p>\n<h2 class=\"heading1\">Edit Hosts File on Windows:<\/h2>\n<p><span style=\"color: #000000;\">On Windows operating systems this file is available with name \u201c<strong>hosts<\/strong>\u201d\u00a0at following location:<\/span><\/p>\n<div class=\"cpanel-files\"><\/div>\n<pre class=\"lang:default decode:true \">C:\\Windows\\System32\\drivers\\etc\\<\/pre>\n<div class=\"space1\"><\/div>\n<p><span style=\"color: #000000;\">Edit \u201c<strong>hosts<\/strong>\u201d file in notepad and make any entry like below at end of file.<\/span><\/p>\n<div class=\"cpanel-files\"><\/div>\n<pre class=\"lang:default decode:true \">127.0.0.1   localhost.localdomain   localhost\r\n::1         localhost6.localdomain6 localhost6\r\n\r\n192.168.1.100     testdomain\r\n192.168.1.100     www.testdomain.com\r\n10.10.0.11        site1.testdomain.com site2.testdomain.com<\/pre>\n<div class=\"space1\"><\/div>\n<p><span style=\"color: #000000;\">Save file. Now you have done mapping between domain name and IP locally on your system.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>So often you will need to edit the hosts file on your machine. Sometimes because of an attack \u00a0and others so that you can simply and freely control access to websites and network traffic.This file is available on each operating systems and useful for mapping domains with IP address without making any DNS entry. Using [&#8230;]<\/p>\n<p><a class=\"understrap-read-more-link\" href=\"https:\/\/cpanelplesk.com\/wp62\/how-to-edit-hosts-file-on-your-system\/\">Continue Reading&#8230;<\/a><\/p>\n","protected":false},"author":19,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,14],"tags":[],"class_list":["post-3183","post","type-post","status-publish","format-standard","hentry","category-cpanel","category-linux"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How To Edit Hosts File on Your System - cPanel Plesk<\/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:\/\/cpanelplesk.com\/wp62\/how-to-edit-hosts-file-on-your-system\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"How To Edit Hosts File on Your System - cPanel Plesk\" \/>\n<meta name=\"twitter:description\" content=\"So often you will need to edit the hosts file on your machine. Sometimes because of an attack \u00a0and others so that you can simply and freely control access to websites and network traffic.This file is available on each operating systems and useful for mapping domains with IP address without making any DNS entry. Using [...]Continue Reading...\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"samama\" \/>\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:\/\/cpanelplesk.com\/wp62\/how-to-edit-hosts-file-on-your-system\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-edit-hosts-file-on-your-system\/\"},\"author\":{\"name\":\"samama\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/b5c17eff2915a029433dfd2d5a6e8465\"},\"headline\":\"How To Edit Hosts File on Your System\",\"datePublished\":\"2015-11-30T07:05:30+00:00\",\"dateModified\":\"2021-02-18T04:46:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-edit-hosts-file-on-your-system\/\"},\"wordCount\":178,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13\"},\"articleSection\":[\"Cpanel\",\"Linux\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-edit-hosts-file-on-your-system\/\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-edit-hosts-file-on-your-system\/\",\"name\":\"How To Edit Hosts File on Your System - cPanel Plesk\",\"isPartOf\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#website\"},\"datePublished\":\"2015-11-30T07:05:30+00:00\",\"dateModified\":\"2021-02-18T04:46:54+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-edit-hosts-file-on-your-system\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cpanelplesk.com\/wp62\/how-to-edit-hosts-file-on-your-system\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-edit-hosts-file-on-your-system\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cpanelplesk.com\/wp62\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Edit Hosts File on Your System\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#website\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/\",\"name\":\"cPanel Plesk\",\"description\":\"Blog on famous hosting control panels\",\"publisher\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cpanelplesk.com\/wp62\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13\",\"name\":\"Farooq Omer\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png\",\"contentUrl\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png\",\"width\":300,\"height\":44,\"caption\":\"Farooq Omer\"},\"logo\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/b5c17eff2915a029433dfd2d5a6e8465\",\"name\":\"samama\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5ad71c1d187b45a3c1a68698160b5f6d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5ad71c1d187b45a3c1a68698160b5f6d?s=96&d=mm&r=g\",\"caption\":\"samama\"},\"url\":\"https:\/\/cpanelplesk.com\/wp62\/author\/samama\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Edit Hosts File on Your System - cPanel Plesk","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:\/\/cpanelplesk.com\/wp62\/how-to-edit-hosts-file-on-your-system\/","twitter_card":"summary_large_image","twitter_title":"How To Edit Hosts File on Your System - cPanel Plesk","twitter_description":"So often you will need to edit the hosts file on your machine. Sometimes because of an attack \u00a0and others so that you can simply and freely control access to websites and network traffic.This file is available on each operating systems and useful for mapping domains with IP address without making any DNS entry. Using [...]Continue Reading...","twitter_misc":{"Written by":"samama","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-edit-hosts-file-on-your-system\/#article","isPartOf":{"@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-edit-hosts-file-on-your-system\/"},"author":{"name":"samama","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/b5c17eff2915a029433dfd2d5a6e8465"},"headline":"How To Edit Hosts File on Your System","datePublished":"2015-11-30T07:05:30+00:00","dateModified":"2021-02-18T04:46:54+00:00","mainEntityOfPage":{"@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-edit-hosts-file-on-your-system\/"},"wordCount":178,"commentCount":0,"publisher":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13"},"articleSection":["Cpanel","Linux"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-edit-hosts-file-on-your-system\/","url":"https:\/\/cpanelplesk.com\/wp62\/how-to-edit-hosts-file-on-your-system\/","name":"How To Edit Hosts File on Your System - cPanel Plesk","isPartOf":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#website"},"datePublished":"2015-11-30T07:05:30+00:00","dateModified":"2021-02-18T04:46:54+00:00","breadcrumb":{"@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-edit-hosts-file-on-your-system\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cpanelplesk.com\/wp62\/how-to-edit-hosts-file-on-your-system\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-edit-hosts-file-on-your-system\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cpanelplesk.com\/wp62\/"},{"@type":"ListItem","position":2,"name":"How To Edit Hosts File on Your System"}]},{"@type":"WebSite","@id":"https:\/\/cpanelplesk.com\/wp62\/#website","url":"https:\/\/cpanelplesk.com\/wp62\/","name":"cPanel Plesk","description":"Blog on famous hosting control panels","publisher":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cpanelplesk.com\/wp62\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13","name":"Farooq Omer","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/","url":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png","contentUrl":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png","width":300,"height":44,"caption":"Farooq Omer"},"logo":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/"}},{"@type":"Person","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/b5c17eff2915a029433dfd2d5a6e8465","name":"samama","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/5ad71c1d187b45a3c1a68698160b5f6d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5ad71c1d187b45a3c1a68698160b5f6d?s=96&d=mm&r=g","caption":"samama"},"url":"https:\/\/cpanelplesk.com\/wp62\/author\/samama\/"}]}},"_links":{"self":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/posts\/3183","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/users\/19"}],"replies":[{"embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/comments?post=3183"}],"version-history":[{"count":0,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/posts\/3183\/revisions"}],"wp:attachment":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/media?parent=3183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/categories?post=3183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/tags?post=3183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}