Click on the hosts file and choose Open :. Enter each IP address on its own line. For each IP address, you can add multiple hostnames on the same line. To get started, open the Terminal application. Now, you can add as many entries as needed using the text editor.
To navigate the text editor, use the arrow keys to move between lines and hit enter to create a new line. The only downside with this approach is that it might not work properly if you use a CDN. That makes it an essential tool when migrating your website. With this method, you're able to ensure that:.
It's actually a very simple process. Let's take a look at an example hosts file:. In this case, the first three entries are defaults used to configure the local network interface. You may have more or less local entries in your hosts file. You do not need to worry about them other than to note their presence.
Any custom entries will go at the bottom of the file, and in this case, you can see that we have added a custom entry to the end of the file already:.
My custom entry specifies that any request made from my computer via a web browser or SSH, email, or FTP client for liquidweb. To redirect your specific request, you must add your own custom entry to the end of your file using the same format.
The line for your custom entry will consist of three elements. If you're migrating to a Liquid Web server, your migration technician will supply you with the information to add. Simply copy and paste the line into your hosts file. If your migration involves multiple IP addresses, you will have one line for each IP address, regardless of how many domain names share it. The location of your computer's hosts file depends on your operating system. Because it is a protected file that must be edited with administrative privileges, the procedure for editing also varies by the operating system.
Click a link below to skip ahead to the specific instructions for your operating system. If you experience difficulties editing your hosts file or are not seeing the sites on the new server after you've followed the steps below, check out the Bonus: If All Else Fails section at the end of this article.
Here are the video instructions for editing your Windows hostfile! You will need to edit the file with administrative privileges. Step 1. Click the Windows button and type 'Notepad' in the search box.
Step 2. Right-click on 'Notepad' and then 'Run as Administrator'. Step 3. Choose 'Yes' on the User Account Control pop-up. Step 4. In Notepad, choose 'File' then 'Open'. Step 5. Step 6. Choose Notepad from the list and then OK. Step 7. Add the appropriate IP and hostname given by the Migration team at the end of your hosts' file, select Save, and close the file.
Step 8. Next, you will want to flush your DNS cache so you don't have to log out and back in for the changes to take effect. Step 9. Sydney Butler is a social scientist and technology fanatic who tries to understand how people and technology coexist. He has two decades of experience as a freelance computer technician and more than a decade as a technologies researcher and instructor. Sydney has been a professional technology writer for more than five years and covers topics such as VR, Gaming, Cyber security and Transhumanism.
Read Sydney's Full Bio. We hate spam too, unsubscribe at any time. Table of Contents. Subscribe on YouTube! Did you enjoy this tip? Therefore ensure that you have set static IP addresses for your Linux hosts or nodes running other operating systems. For the purpose of this article, we will be using the following domain, hostnames and IP addresses use values that apply to your local setting.
It provides Name Service Switch functionality which controls the order in which services are queried for name service lookups. But if DNS is before files then the domain lookup process will consult DNS first before any other appropriate services or files. To check the order, type. Next, test if everything is working well as expected, using the ping command from Host 1 , you can ping Host 2 using it domain name like so.
What does this mean, in the above example, we only configured the hosts file of Host 1 and we can only use the domain names on it. To use the same names on Host 2 , we have to add the addresses and names to its hosts file as well. Do share any additional thoughts or questions about this topic with us, via the comment section below.
0コメント