• 8 September 2024

When you enable the ArvanCloud CDN, the Cloud icon lights up in your website’s user interface. When you enable this icon, the IP address of your website’s main server is hidden behind the ArvanCloud servers, and when you check the website with tools such as Ping and Traceroute, the response is returned from the ArvanCloud servers.

However, sometimes it is necessary to check the main server hosting the website directly. For example, when displaying 500 errors, these errors indicate a problem on the side of the main server hosting the website, and it is necessary to ensure the correctness of the connection and operation of this server.

To check the authenticity of the connection with the main server without turning off the cloud icon, the following two methods can be used:

  • Manually entering the domain name and IP address of the main server of the website host into the host’s file of the operating system
  • Using the cURL tool

Manually Setting the Domain Name and IP Address of the Main Server into the Hosts File

Windows Operating System

When resolving a domain name to an IP address, the system first checks its local DNS file (hosts file) before referring to the DNS server configured for the gateway (modem). So, if you include the domain name and IP address of the main server hosting the website in this file, the system can do something directly without referring to a DNS server outside the system.

To access this file in Windows 8, 8.1 and 10 operating systems, open the NotePad software as “Run as administrator”. Then select “Open” from the “File” menu and in the opened window enter the address “c:\windows\system32\drivers\etc\hosts” in the “File name” field. Then click the Open button.

At the end of this file you can add the name of the website along with its IP address in the format specified in the file (e.g. x.x.x example.com), then save and close the file.

Linux Operating System

Open the Terminal window and enter the following command.

sudo nano /etc/hosts

After entering the above command, the system will ask you for a password. After you enter the correct password, you can access the contents of the hosts file. Then, in the hosts file, first enter the IP address of the main server hosting the website and then your domain name after pressing the Tab key.

Mac OS

To do this, first type the following command in the Terminal window:

sudo nano /private/etc/hosts

After entering the above command, the system will ask you for a password (this password is the same one you use when logging in); by entering the password, you can access the contents of the hosts file. In the hosts file, enter your IP address along with your domain name and save the changes by pressing Ctrl+X. You can also use the following command to clear the DNS cache and make the changes take effect quickly:

dscacheutil –flushcache

Note that in all three cases described above, after the test is complete, you can put a “#” in front of the line you added to the hosts file so that the operating system ignores that line when it references the hosts file. Whenever you need to test and verify the main server hosting your website, you can remove the # from the beginning of the line.

Second Method: Using the Curl Tool

The  –-resolve option in the curl command specifies that this command queries the specified URL instead of DNS or the /etc/hosts file:

curl --resolve hostname:port:DESTINATIONIPADDRESS http(s)://www.example.com