> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.xynta.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Modifying your hosts file

||| ℹ️ **Note:** This article is intended to temporarily point a domain name to a specific IP address for personal use.
---

By modifying your hosts file, you can locally point a domain name to a specific IP address. This is useful when moving or testing a website without affecting other visitors.

* [Windows](#2-windows)
* [macOS or Linux](#2-macos-or-linux)
* [Retrieving the IP address via Website Check](#2-retrieving-the-ip-address-via-website-check)
---

## 📋 Windows

Follow these steps to modify your hosts file in Windows:

1. Open **Notepad** as an administrator.
Right-click the Notepad icon and choose **Run as administrator**.

2. Navigate in Notepad to the file path:
   `C:/Windows/System32/Drivers/etc/`

3. Change the file type filter at the bottom right from **Text Documents (.txt)** to **All Files (.)**.
4. Open the **hosts** file.
5. Add the following line at the bottom of the file:
   
```
[IP-address] [yourdomain.ext] www.[yourdomain.ext]
```

   **Example:**

```
192.168.1.1 example.cc www.example.cc
```

6. Save the changes.

💡 *To undo the change, simply remove the added line.*
---

## 📋 macOS or Linux

Follow these steps to modify your hosts file in macOS or Linux:

1. Open **Terminal** via the search icon at the top right.
2. Run one of the following commands:

```
sudo nano /private/etc/hosts
```

   or
   
```
sudo vi /private/etc/hosts
```

   *(Nano is recommended for easier editing.)*

3. Enter your password when prompted and press Enter.
4. Add the following line at the bottom of the file:
   
```
[IP-address] [yourdomain.ext] www.[yourdomain.ext]
```

   **Example:**

```
192.168.1.1 example.cc www.example.cc
```

5. Save the file:
   
* With **Nano**: press **Control + X**, confirm with **Y**, and press **Enter**.
* With **Vi**: type **:wq** and press **Enter**.

6. Then run:
   
```
dscacheutil -flushcache
```

💡 *You can undo the change by removing the added line.*
---

## 📋 Retrieving the IP address via Website Check

Follow these steps to find your server’s IP address:

1. Visit our [Website Check](https://www.xynta.com/website-check).
2. Enter your domain name or server hostname.
3. Click the orange **Check** button.

You will then see a message like:

> The domain example.cc points to server dhsX (192.168.1.1).

where **192.168.1.1** is the IP address you should use in your hosts file.
---

||| 📬 Questions? Feel free to contact us!