[Osaka/Yokohama] Looking for infrastructure/server side engineers!

[Osaka/Yokohama] Looking for infrastructure/server side engineers!

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Successor to CentOS] AlmaLinux OS server construction/migration service

[Successor to CentOS] AlmaLinux OS server construction/migration service

[For WordPress only] Cloud server “Web Speed”

[For WordPress only] Cloud server “Web Speed”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Low cost] Wasabi object storage construction and operation service

[Low cost] Wasabi object storage construction and operation service

[Reservation system development] EDISONE customization development service

[Reservation system development] EDISONE customization development service

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Compatible with over 200 countries] Global eSIM “beSIM”

[Compatible with over 200 countries] Global eSIM “beSIM”

[Compatible with Chinese corporations] Chinese cloud / server construction, operation and maintenance

[Compatible with Chinese corporations] Chinese cloud / server construction, operation and maintenance

[YouTube] Beyond official channel “Biyomaru Channel”

[YouTube] Beyond official channel “Biyomaru Channel”

Hosts書き換えの強い味方!「Hosts File Manager」

インフラエンジニアの伊藤です。
現在使用しているサーバを移転する際、新サーバのIPアドレスとドメイン名の紐付けがされていないために、
ドメイン名にアクセスすると「現在使用しているサーバ」が見えます。
そんなとき、自分のPC上のみ移転先のサーバへドメイン名とIPアドレスの紐付けを行うのがhostsファイルになります。

hostsファイルは以下ディレクトリにあり、編集が少し面倒なんですよね。

%systemroot%system32driversetchosts

そんな編集が少し面倒なhostsファイルを便利に管理するソフトウェア「Hosts File Manager」を紹介します!

設定・使い方

Host File Managerは以下のページからダウンロードが可能です。

Hosts File Manager

インストール後に起動すると、以下のような画面が現れます。
(既に設定済みなので、新規の場合は少し違うかもしれません)

SnapCrab_hosts - Hosts File Manager_2016-1-12_11-43-32_No-00

まずは現在のhostsファイルを開きます。
SnapCrab_NoName_2016-1-12_11-51-6_No-00_011216_115427_AM

レコードを追加します。
SnapCrab_NoName_2016-1-12_12-8-4_No-00_011216_120937_PM

新サーバのIPアドレス、ホスト名のところにドメインを入力します。
(もちろん下記で記入しているIP・ドメインは架空です)
SnapCrab_NoName_2016-1-12_12-12-28_No-00

[OK]をクリックすると、レコードが追加されていることが確認出来ます。
SnapCrab_NoName_2016-1-12_12-34-27_No-00_011216_123522_PM

このままでは反映されていないので、「上書き保存」しましょう。
管理者権限が必要な場合は、その旨が通知されるので、[OK」をクリックしてください。
SnapCrab_NoName_2016-1-12_12-36-52_No-00_011216_123852_PM

実際にhostsファイルを見ると、設定が反映されていることが確認出来ます!
SnapCrab_hosts_-_メモ帳_2016-1-12_12-42-36_No-00_011216_124407_PM

便利なところ

紹介した使い方で簡単にHostsファイルの設定管理が出来るのですが、
まだ便利なところがあります。

それは、各Hosts設定の左側にあるチェックボックスです。
チェックボックスの有無で、hostsファイルの設定を有効・無効化が可能なのです。
※チェックボックスの設定実施後は、上書き保存をしないと設定が反映されないので注意※

SnapCrab_NoName_2016-1-12_12-12-28_No-00

上記の紹介した設定であると、こうなります。

チェックボックス ドメイン名 接続先
あり test.example.com 192.168.1.1
なし test.example.com 元のサーバ

チェックボックスの有無で反映されたりされなかったりするので、編集がかなり楽になります。

まとめ

サーバ移管をするときは結構頻繁にhostsファイルを使います。
そんなときにいちいちhostsファイルを編集していると、時間がかかります。

こういった便利ツールを使えば、少しでも効率的に仕事できるはずですので、
是非参考にしてみてください!

ダウンロードページは以下から
Hosts File Manager

この記事がお役に立てば【 いいね 】のご協力をお願いいたします!
0
読み込み中...
0 票, 平均: 0.00 / 10
7,209
X facebook はてなブックマーク pocket
[2024.6.30 CentOS support ended] CentOS server migration solution

[2024.6.30 CentOS support ended] CentOS server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[Osaka/Yokohama] Actively recruiting infrastructure engineers and server side engineers!

[Osaka/Yokohama] Actively recruiting infrastructure engineers and server side engineers!

The person who wrote this article

About the author