Modifying the hosts file on macOS

First, you need to open the Terminal app. You can find the Terminal app by going to "Go > Utilities" in the Finder. Then double click to open the Terminal app.

Next, you need to enter the following command to edit the hosts file. You can also use your preferred text editor, but note you will need admin rights:

sudo nano /etc/hosts

Then press enter and provide your admin password. You will then see the contents of the hosts file with your cursor at the bottom.

At the end of the file, you can add the domain names and IP addresses you want to modify. For example:

123.123.123.123 mydomain.com

In this example, you would replace "123.123.123.123" with the IP address you want to specify, and "mydomain.com" with the domain you want to modify.

Once done editing, you can press "Control + O" to save changes, then press enter to confirm the save. After that, press "Control + X" to exit the editor.