Windows 10 에서 hosts

개발시에는 로컬 환경에서 다른 도메인을 이용하여 개발 및 테스트를 하였기에 다음과 같이 구성하였다.


C:\Windows\System32\drivers\etc 폴더를 확인하면 위와 같이 파일을 확인할 수 있습니다.

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#	127.0.0.1       localhost
#	::1             localhost

127.0.0.1 view-localhost # view localhost server

호스트 파일을 열면 위와 같은 내용을 볼 수 있습니다.

문서 끝에 다음 형식을 추가하고 저장합니다.

  • 127.0.0.1 보기-localhost

ipconfig /flushdns

변경된 hosts 파일 정보를 반영하기 위해 cmd 창에 위의 내용을 입력합니다.