これは私のhosts
ファイルです ( c:\WINDOWS\system32\drivers\etc )
# Copyright (c) 1993-1999 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
127.0.0.1 localhost
x.x.x.x my.hostname1
#x.x.x.x my.hostname2
xxxx は私の実際の IP です。Windows XP で 127.0.0.1:80 で Tomcat 6.0 サーバーを実行しています (私のマシンではなく、私を責めないでください)。そのため、localhost または xxxx を開くと、Tomcat のエラー メッセージが表示されます (ただし、URL にプロジェクト名を入力していないため、問題ありません)。
my.hostname1 を開くと、ネットワーク エラー ページが表示されます。hosts
ファイル内のmy.hostname1をmy-hostname1に置き換えると、動作は localhost や xxxx と同じになるため、問題はホスト名のドット (.) 文字だと思います。ホスト名にドットを含める方法はありますか?
ありがとうございました
編集:cmdで実行した出力ping my.hostname1
Pinging my.hostname1[x.x.x.x] with 32 bytes of data:
Reply from x.x.x.x: bytes=32 time<1ms TTL=128
Reply from x.x.x.x: bytes=32 time<1ms TTL=128
Reply from x.x.x.x: bytes=32 time<1ms TTL=128
Reply from x.x.x.x: bytes=32 time<1ms TTL=128
Ping statistics for x.x.x.x:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms