From the course: Linux System Engineer: Networking and SSH

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Edit system hosts file

Edit system hosts file

From the course: Linux System Engineer: Networking and SSH

Start my 1-month free trial

Edit system hosts file

- [Instructor] The Etsy host file is the simplest way to provide name resolution and is super easy to edit. You'll need to be in Root to do it, though. First let's get our IP address. In the terminal type in IP space addr space show and hit Enter. We can see that my IP address is 192.168.0.19. Now let's edit the Etsy host file using VI. Type in clear and then type in sudo space VI slash etc slash hosts and hit Enter. If you prompts you for a password, enter it now. We're going to go into insert mode by pressing the I key, and then we'll go to the end of the line and hit Enter. Now let's add our IP address 192.168.0.19 here. Substitute this with your IP address on your machine. The syntax has a left-hand column with an IP address and then other columns for the names to resolve. You can put a host name in here, a fully qualified domain name, or both. Let's add in mydomain.com, and let's save this by pressing Escape, colon, X, and hitting Enter. Now pinging this domain, ping space…

Contents