DNSの設定を端末で独自に設定するには
ローカルエリアのネットワークなどでサーバーを立ててる場合や使用していたドメインが消失した場合、
またはドメインが登録されているネームサーバーのトラブルなどでIPアドレスが引けない場合の設定です。
それぞれのパソコン内でDNSを個別に設定することができます。
ドメインなどからIPアドレスに変換することを名前解決といいます。
方法はhostsファイルを設定変更します。
hostsファイルの設置場所
| OS | hosts ファイルの場所 | 例 |
|---|---|---|
| Windows Vista Windows XP Windows 2000 Windows NT | %Systemroot%¥system32¥drivers¥etc | C:¥WINDOWS¥system32¥drivers¥etc |
| Windows Me Windows 98 Windows 95 | <ドライブ>¥<Windows フォルダ> | C:¥WINDOWS |
| Windows for Workgroups | <ドライブ>¥<Windows フォルダ> | C:¥WINDOWS |
| Windows 3.1 | <ドライブ>¥<Windows フォルダ> | C:¥WINDOWS |
| MS-Client 3.0 | <起動ボリューム>¥Net | C:¥Net |
| Lan Manager 2.2c クライアント | <起動ボリューム>¥Net | C:¥Net |
| Windows NT | 説明 |
|---|---|
| %Systemroot% | Windows がインストールされているフォルダ |
| <ドライブ> | Windows がインストールされているドライブ |
| <起動ボリューム> | 通常フロッピー ディスクまたは C ドライブ |
hostsファイルの設定方法
# 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
ここに
【IPアドレス】 【ドメイン名】
のように追記します。
例1
127.0.0.1 localhost
例2
192.168.10.1 test.example.com
この設定はファイルを保存した時点で、すぐに反映されるので、再起動の必要はありません。
名前解決の優先順位
| 順位 | 説明 |
|---|---|
| 1 | コンピュータ名。これに一致していたら自分を見る |
| 2 | hosts ファイル |
| 3 | DNSサーバー |
| 4 | NetBIOS |
この順序は、クライアントの NetBIOS ノードの種類を設定することで変更できます。




