본문 바로가기

ProgrammingStudy/OS

[Windows] Hosts Setup

반응형

hosts?

  • 운영 체제가 호스트 이름을 IP 주소에 매핑할때 사용하는 파일.
  • 입력한 URL이 DNS를 통하지 않고 자신이 원하는 IP로 접속해야할 때 설정

 

호스트네임, 노드네임(Hostname, or nodename)

  • 네트워크에 연결된 장치(컴퓨터, 파일 서버, 복사기, 케이블 모뎀 등)들에게 부여되는 고유한 이름.
  • 인터넷에서는 월드 와이드 웹, 전자 우편, 유즈넷 등에서 호스트명을 흔히 사용
  • 도메인 이름과 유사하지만 더 넓은 의미를 가지고 있다.

 

수정방법

1. 다음위치에서 hosts 파일을 찾는다. 

C:\Windows\System32\drivers\etc

2. 원본은 백업해두기

 

3. hosts 파일을 메모장으로 열어서 문서 가장 하단에 <ip주소> <호스트네임>을 입력

# 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 www.host.com
127.0.0.2 www.hosthost.co.kr
127.0.0.3 www.host.io
127.0.0.4 www.host.net
127.0.0.5 www.host.org

 

반응형