プロが教えるわが家の防犯対策術!

Hostsファイルの書き方

Hostsファイルの書き方には、
いくつかのパターンがあると聞きました。

全てパターンを教えて下さい。

ちなみに、私は、
192.168.1.100 WebServer01
という書き方しか知らないです。

よろしくお願いします。

A 回答 (1件)

hostsファイルの中のマイクロソフトのコメントの仕様、および書き方を読めば、それが全てなのでは?


下記はWin7のhostsのコメントを貼り付けたものです。
-----引用始まり
# 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
-----引用終わり
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!