Last updated on: 2019-07-23 Show Authored by: Rackspace Support Modifying your hosts file enables you to override the domain name system (DNS) for a domain on a specific machine. DNS management is useful when you want to test your site without the test link prior to going live with SSL, verify that an alias site works prior to DNS changes, and for other DNS-related reasons. For information about changing your DNS settings, see Changing DNS settings on Linux. Modifying your hosts file causes your local machine to look directly at the Internet Protocol (IP) address that you specify. Rackspace offers managed hosting solutions to assist with the handling of these resources. Modifying the hosts file involves adding two entries to it. Each entry contains the IP address to which you want the site to resolve and a version of the Internet address. For example, add the following two entries points, www.domain.com and domain.com, to Rackspace’s current refreshed PHP5 (PHP5-ITK) cluster:
This article provides instructions for locating and editing the hosts file on the following operating systems:
After you add the domain information and save the file, your system begins to resolve to the IP address that you specified. When testing is complete, remove these entries. WindowsIf you are using a Microsoft operating system like Windows 10, Windows 8, Windows 7, and Windows Vista you must run Microsoft Notepad as an administrator. Windows 10 and Windows 8Use the following instructions if you’re running Windows 10 or Windows 8:
Windows 7 and Windows VistaUse the following instructions if you’re running Windows 7 or Windows Vista:
Windows NT, Windows 2000, and Windows XPUse the following instructions if you’re running Windows NT, Windows 2000, or Windows XP:
LinuxUse the following instructions if you’re running Linux:
MacOS X versions 10.0 through 10.12This section provides instructions for modifying your hosts file if you are running MacOS X 10.0 through 10.12. MacOS X 10.0 through 10.1.5Use the following instructions if you’re running MacOS X 10.0 through 10.1.5:
MacOS X 10.6 through 10.12Use the following instructions if you’re running MacOS X 10.6 through 10.12:
How do I add a website to my host file?How to add a static entry in the hosts file?. Open your text editor in Administrator mode.. In the text editor, open C:\Windows\System32\drivers\etc\hosts.. Add the IP Address and hostname. Example: 171.10.10.5 opm.server.com.. Save the changes.. How do I unblock a website from my hosts file?To Unblock Websites Blocked in the Hosts File,
Navigate to the folder C:\Windows\System32\drivers\etc. Select "All Files" from the drop-down menu. Double-click the hosts file. Add the comment symbol # at the beginning of the line that contains the blocked web site you want to unblock.
How do I add a website to my host file Windows 10?Change the File Manually
Once in Notepad, go to File -> Open. Get to C:\Windows\System32\Drivers\etc and make sure to select All Files to find the hosts file. Now you can edit the hosts file. Add the custom IP address you've made earlier, followed by a space, then your domain name.
How do I change my host file permissions?Windows. Press the Windows key.. Type Notepad in the search field.. In the search results, right-click Notepad and select Run as administrator.. From Notepad, open the following file: c:\Windows\System32\Drivers\etc\hosts.. Make the necessary changes to the file.. Select File > Save to save your changes.. |