Windows通過hosts檔案解析域名

Michael_DD發表於2015-07-23
Windows通過hosts檔案解析域名



測試環境:windows 7  (31bit)
檔案路徑:
C:\Windows\System32\drivers\etc\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






增加一行:
192.168.9.248 szpuppet.server.com


測試:
C:\Users\dong.du>ping szpuppet.server.com


正在 Ping szpuppet.server.com [192.168.9.248] 具有 32 位元組的資料:
來自 192.168.9.248 的回覆: 位元組=32 時間=1ms TTL=62
來自 192.168.9.248 的回覆: 位元組=32 時間=1ms TTL=62
來自 192.168.9.248 的回覆: 位元組=32 時間=1ms TTL=62


192.168.9.248 的 Ping 統計資訊:
    資料包: 已傳送 = 3,已接收 = 3,丟失 = 0 (0% 丟失),
往返行程的估計時間(以毫秒為單位):
    最短 = 1ms,最長 = 1ms,平均 = 1ms
Control-C
^C
C:\Users\dong.du>






來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29500582/viewspace-1745241/,如需轉載,請註明出處,否則將追究法律責任。

相關文章