Before public DNS servers became widely available, operating systems relied on the local hosts file to map hostnames to IP addresses.
Modern operating systems still support manually editing this file. This allows you to override standard DNS resolution and direct a hostname to a specific IP address.
This capability is useful for testing and development. In this article, you will learn how to use the hosts file to connect directly to your hosting server without routing the connection through the Web Application Firewall (WAF).
Editing the ‘hosts’ file
Find and copy your hosting IP address by accessing the Hosting IP Address page of the WAF dashboard.

The next steps depends on your operational system.
Microsoft® Windows
1) Select the Windows key, search for “notepad”, right-click on Notepad and select the option Run as administrator.

2) Once the Notepad is open, go to File -> Open and type c:\windows\system32\drivers\etc on the path field. The “c:\” disk could be another letter, just make sure you’re accessing the primary disk of your system, which is usually where Windows was installed.


3) The ‘hosts’ file won’t show right away because Notepad usually lists only text files, so you need to select “All Files” on the bottom of the window.

Make sure you click on the ‘hosts’ file that shows as “File” on the Type column as there are two files named “hosts”.
4) Inside the file, at the very end, add a line following this structure:
208.104.52.26 www.awesomewebsite.com awesomewebsite.com
5) Replace awesomewebsite.com with your domain and 208.104.52.26 with your hosting IP.
6) Save the file and exit Notepad.

7) Just like you did before to run Notepad as administrator, now search for cmd.exe on the Start Menu, right-click and select the option Run as administrator.

8) Type “ipconfig /flushdns” on the command prompt window and press “Enter” so the changes take effect. After doing this you can close the command prompt window.

macOS, Linux or any Unix-like system
1) Open the Terminal.
On macOS, you can search on Spotlight or find the Terminal at Applications -> Utilities folder.

Because Linux has many distributions with different interfaces, there are numerous ways to find Terminal. If you are running a distro similar to Ubuntu, press “Ctlr + Alt + T” and you are likely to open the Terminal this way. To be sure, research how to open a Terminal window in your distribution’s documentation.
2) Type sudo nano /etc/hosts on the Terminal window and enter your password so you can open the Nano Text Editor as root.

If you see Command 'nano' not found message, your Linux distribution may not have Nano Text Editor installed. You can choose a different editor such as Vim, Gedit, etc. or you can install Nano with your distribution package manager. If you are running a distro similar to Ubuntu, run the command sudo apt install nano on Terminal to install the Nano Text Editor.
3) Inside the file, at the very end, add a line following this structure:
208.104.52.26 www.awesomewebsite.com awesomewebsite.com
4) Replace awesomewebsite.com with your domain and 208.104.52.26 with your hosting IP.

5) Press “Ctrl + X”, then “Y” and then “Enter” to confirm saving the file with the same name.


Once complete, you should be able to view your website directly from the hosting server. When testing, please use an incognito browser mode to ensure the DNS is not cached. You can use Developer Tools on your browser to inspect the headers to determine the remote address you’re connected to.
Troubleshooting
403 Error When Bypassing
If you’ve implemented Firewall Bypass Prevention, then you will need to add your own IP address (which can be found here to the FileMatch directive:
# BEGIN Sucuri Firewall Bypass Prevention
<FilesMatch ".*">
Order deny,allow
Deny from all
Allow from 192.88.134.0/23
Allow from 185.93.228.0/22
Allow from 66.248.200.0/22
Allow from 208.109.0.0/22
Allow from 2a02:fe80::/29
Allow from INSERT YOUR IP HERE
</FilesMatch>
# END Sucuri Firewall Bypass Prevention