{"id":6956,"date":"2022-04-28T01:31:19","date_gmt":"2022-04-28T01:31:19","guid":{"rendered":"https:\/\/www.cldy.com\/support\/?post_type=docs&#038;p=6956"},"modified":"2022-09-17T10:38:13","modified_gmt":"2022-09-17T02:38:13","password":"","slug":"how-to-modify-your-hosts-file","status":"publish","type":"docs","link":"https:\/\/www.cldy.com\/support\/help\/how-to-modify-your-hosts-file\/","title":{"rendered":"How to Modify your Hosts File in Windows and Mac?"},"content":{"rendered":"<h3><strong>When do you need to edit your Hosts File<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">Hosts file (hostfile) needs to be modified in cases when you need to manually override the DNS (domain name system) for a specific domain. When you do so, your local computer can directly access the IP address that you have specified in your hosts file.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">What you need to do is to add two entries: an entry for the IP address that you want the site to resolve, and an entry for one version of the web address of the domain. This is an example:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">100.00.000.001 <\/span><span style=\"font-weight: 400;\">www.yourdomainhere.com<br \/>\n<\/span><span style=\"font-weight: 400;\">100.00.000.001 yourdomainhere.com<\/span><\/p>\n<p>&nbsp;<\/p>\n<h3><strong>How to edit your Hosts File<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">Select your corresponding OS and follow the steps as provided:<\/span><\/p>\n<h3><strong>For Windows<\/strong><\/h3>\n<ol>\n<li><span style=\"font-weight: 400;\">Hit the Windows key from your keyboard.<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Search \u201cnotepad\u201d.<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><img decoding=\"async\" class=\"alignnone size-full wp-image-6957\" src=\"https:\/\/www.cldy.com\/support\/wp-content\/uploads\/sites\/12\/2022\/04\/modify-hosts-file_search-notepad.png\" alt=\"\" width=\"204\" height=\"75\" \/><\/li>\n<li><span style=\"font-weight: 400;\">Once the search results come up, right-click on Notepad and click on <\/span><b>Run as administrator<\/b><span style=\"font-weight: 400;\">.<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/li>\n<li><span style=\"font-weight: 400;\">You may receive an alert \u201cDo you want to allow this app to make changes to your device?\u201d Click on <\/span><b>Yes<\/b><span style=\"font-weight: 400;\">.<br \/>\n<\/span><\/li>\n<li><span style=\"font-weight: 400;\">From Notepad, click on File, then Open (or hit Ctrl + O from your keyboard), and search for this filename:<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>c:\\Windows\\System32\\Drivers\\etc\\hosts<br \/>\n<\/b><img decoding=\"async\" class=\"alignnone size-full wp-image-6958\" src=\"https:\/\/www.cldy.com\/support\/wp-content\/uploads\/sites\/12\/2022\/04\/modify-hosts-file_notepad-open-hosts-file.png\" alt=\"\" width=\"520\" height=\"569\" srcset=\"https:\/\/www.cldy.com\/support\/wp-content\/uploads\/sites\/12\/2022\/04\/modify-hosts-file_notepad-open-hosts-file.png 520w, https:\/\/www.cldy.com\/support\/wp-content\/uploads\/sites\/12\/2022\/04\/modify-hosts-file_notepad-open-hosts-file-274x300.png 274w\" sizes=\"(max-width: 520px) 100vw, 520px\" \/><\/li>\n<li><span style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">At the last line, add the necessary information.<\/span><\/span><\/li>\n<li><span style=\"font-weight: 400;\">Click on File, then Save, to save the modifications you have added.<\/span><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h3><strong>For Mac<\/strong><\/h3>\n<ol>\n<li><span style=\"font-weight: 400;\">From Finder, go to <\/span><b>Applications<\/b><span style=\"font-weight: 400;\">.<br \/>\n<\/span><img decoding=\"async\" class=\"alignnone size-full wp-image-6960\" src=\"https:\/\/www.cldy.com\/support\/wp-content\/uploads\/sites\/12\/2022\/04\/modify-hosts-file-mac_applications.png\" alt=\"\" width=\"208\" height=\"25\" \/><\/li>\n<li><span style=\"font-weight: 400;\">Then click on <\/span><b>Utilities<\/b><span style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">.<br \/>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-6964\" src=\"https:\/\/www.cldy.com\/support\/wp-content\/uploads\/sites\/12\/2022\/04\/modify-hosts-file-mac_utilities.png\" alt=\"\" width=\"238\" height=\"21\" \/><\/span><\/span><\/li>\n<li><span style=\"font-weight: 400;\">And go to <\/span><b>Terminal<\/b><span style=\"font-weight: 400;\">.<br \/>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-6963\" src=\"https:\/\/www.cldy.com\/support\/wp-content\/uploads\/sites\/12\/2022\/04\/modify-hosts-file-mac_terminal.png\" alt=\"\" width=\"275\" height=\"18\" \/><br \/>\n<\/span><\/li>\n<li><span style=\"font-weight: 400;\">The Terminal window will now open.<br \/>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-6962\" src=\"https:\/\/www.cldy.com\/support\/wp-content\/uploads\/sites\/12\/2022\/04\/modify-hosts-file-mac_open-terminal.png\" alt=\"\" width=\"566\" height=\"363\" srcset=\"https:\/\/www.cldy.com\/support\/wp-content\/uploads\/sites\/12\/2022\/04\/modify-hosts-file-mac_open-terminal.png 566w, https:\/\/www.cldy.com\/support\/wp-content\/uploads\/sites\/12\/2022\/04\/modify-hosts-file-mac_open-terminal-300x192.png 300w\" sizes=\"(max-width: 566px) 100vw, 566px\" \/><br \/>\n<\/span><span style=\"font-weight: 400;\"><br \/>\nEnter the command as follows:<br \/>\n<strong>sudo nano \/private\/etc\/hosts<br \/>\n<\/strong><br \/>\n<\/span><\/li>\n<li><span style=\"font-weight: 400;\">You will be asked to enter your user password. Type it in and hit Enter.<br \/>\n<\/span><\/li>\n<li><span style=\"font-weight: 400;\">The hosts file will now open.<br \/>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-6961\" src=\"https:\/\/www.cldy.com\/support\/wp-content\/uploads\/sites\/12\/2022\/04\/modify-hosts-file-mac_open-hosts-file.png\" alt=\"\" width=\"568\" height=\"362\" srcset=\"https:\/\/www.cldy.com\/support\/wp-content\/uploads\/sites\/12\/2022\/04\/modify-hosts-file-mac_open-hosts-file.png 568w, https:\/\/www.cldy.com\/support\/wp-content\/uploads\/sites\/12\/2022\/04\/modify-hosts-file-mac_open-hosts-file-300x191.png 300w\" sizes=\"(max-width: 568px) 100vw, 568px\" \/><br \/>\n<\/span><br \/>\n<span style=\"font-weight: 400;\">Add your changes after the last line.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Click on Control + X to save the changes to the hosts file. You will be prompted to confirm the changes &#8211; click on Y on your keyboard.<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/li>\n<li>Then press Control+T to go back to the Terminal window.<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Enter this command in the Terminal window to force the changes to take effect:<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><strong> dscacheutil -flushcache<\/strong><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>When do you need to edit your Hosts File Hosts file (hostfile) needs to be modified in cases when you need to manually override the DNS (domain name system) for a specific domain. When you do so, your local computer can directly access the IP address that you have specified in your hosts file. What [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[31],"doc_tag":[],"class_list":["post-6956","docs","type-docs","status-publish","hentry","doc_category-web-hosting"],"year_month":"2026-07","word_count":322,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"syd123","author_nicename":"syd123","author_url":"https:\/\/www.cldy.com\/support\/author\/syd123\/"},"doc_category_info":[{"term_name":"Web Hosting","term_url":"https:\/\/www.cldy.com\/support\/help-category\/web-hosting\/"}],"doc_tag_info":[],"_links":{"self":[{"href":"https:\/\/www.cldy.com\/support\/wp-json\/wp\/v2\/docs\/6956","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cldy.com\/support\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.cldy.com\/support\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.cldy.com\/support\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cldy.com\/support\/wp-json\/wp\/v2\/comments?post=6956"}],"version-history":[{"count":7,"href":"https:\/\/www.cldy.com\/support\/wp-json\/wp\/v2\/docs\/6956\/revisions"}],"predecessor-version":[{"id":7941,"href":"https:\/\/www.cldy.com\/support\/wp-json\/wp\/v2\/docs\/6956\/revisions\/7941"}],"wp:attachment":[{"href":"https:\/\/www.cldy.com\/support\/wp-json\/wp\/v2\/media?parent=6956"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/www.cldy.com\/support\/wp-json\/wp\/v2\/doc_category?post=6956"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.cldy.com\/support\/wp-json\/wp\/v2\/doc_tag?post=6956"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}