List of hosts file locations

less than 1 minute read

I search every time, so make a note of it.

Location of hosts file

Windows10
C:\Windows\System32\drivers\etc\hosts

macOS
/private/etc/hosts

CentOS7
/etc/hosts

Description

The hosts file is a setting file for the correspondence between the IP address and the host name, and is used when there is a correspondence that you want to use only on a specific computer.
For example, it is used when connecting to the test server with the same host name as the production server on the development personal computer.
The correspondence is described as “IP address (space or tab) host name” (example: “127.0.0.1 localhost”).

Remarks

This article is a migration article from the blog “Technical Notes for Chores Engineers”. The previous blog will be deleted.