Changing the host file
Overview
When setting up an OAuth, certain services, such as Google, do not allow the specifying of an IP address for redirect URIs—instead, these services expect a hostname from which the request will originate. This guide explains how to modify a host file on your local machine to map a known IP address to a hostname. You can then use this hostname instead of the IP address to browse to Matillion ETL or any other service that is accessible via that IP address. This change is local to the machine where changes are made.
Linux
- Open the terminal.
- Open the hosts file in any text editor.
- For example, using nano:
sudo nano /etc/hosts
- Enter the appropriate user password.
- Change the file's contents as you require.
- Close the file by pressing CTRL + X.
- When asked if you want to save your changes, enter y (yes).
Windows 8 & Windows 10
- Press the Windows key or click the Windows menu button to bring up the search function.
- Type in "notepad". (Alternately, browse to it through Start Menu → Windows Accessories → Notepad .)
- Right-click Notepad, hover over More, and click Run as administrator.
- From Notepad, use File → Open and browse to the file:
c:\\Windows\\System32\\Drivers\\etc\\hosts
- Change the file's contents as you require.
- Click File → Save to save your changes.
Windows 7 & Windows Vista
- Browse to Start Menu→All Programs→Accessories.
- Right-click 'Notepad' and select Run as administrator.
- If you have UAC enabled, click Continue to pass the UAC window.
- From Notepad, use File→Open and browse to the file:
c:\\Windows\\System32\\Drivers\\etc\\hosts
- Change the file's contents as you require.
- Use File→Save to save your changes.
OSX 10.0 to 10.12
- Open /Applications/Utilities/NetInfo Manager.
- Allow editing of the NetInfo database by clicking the padlock in the bottom-left corner of the window.
- Enter the appropriate user password.
- In the second column of the browser view, select the node named machines.
- The third column contains entries for -DHCP-, broadcasthost, and localhost.
- Select localhost.
- Repeat this loop for every additional host entry that you want to add:
- Use Edit→Duplicate.
- A confirmation alert appears. Click Duplicate.
- A new entry called localhost copy appears, and its properties are shown below the browser view.
- Double-click the value of the ip_address property and enter the IP address of the other computer.
- Double-click the value of the name property and enter the hostname you want for the other computer.
- Click the serves property and select Delete from the Edit menu.
- From the File menu, select Save.
- A confirmation alert appears.
- Click Update this copy.
- Select Quit from the NetInfo Manager menu.
OSX 10.12 to 10.6
- Open Applications→Utilities→Terminal.
- Open the hosts file by entering this below into the terminal window:
sudo nano /private/etc/hosts
- Enter the appropriate user password.
- Edit the hosts file as below. Lines beginning with the hash symbol (#) are comments. Others describe default hostname mappings (e.g. 127.0.0.1 – local host).
- Enter any new mappings after the default mappings.
- Save the hosts file by pressing Control+X and answering y (yes).
- Flush the DNS cache using the following command in the terminal window:
dscacheutil -flushcache