MacでChromeのDNS Lookupが遅い

MacでChromeのDNSLookupが遅い 技術の備忘録

/etc/hostsに設定したドメインにアクセスしたところ、ChromeのDNS Lookupで10秒も掛かっていました。

Chrome-DNS-lookup

色々なアプリケーションを作成したため、hostsにホストが以下のように膨れていました。

どうやら原因はこのhostsファイルのせいのようです。

127.0.0.1    localhost
127.0.0.1    hoge1.example.com
127.0.0.1    hoge2.example.com
127.0.0.1    hoge3.example.com
127.0.0.1    hoge4.example.com
127.0.0.1    hoge5.example.com

以下のように1行で記載するように修正したところ、劇的に読み込みが速くなりました。

127.0.0.1    localhost hoge1.example.com hoge2.example.com hoge3.example.com hoge4.example.com hoge5.example.com

参考サイト

Chrome Slow to Resolve /etc/hosts on macOS / OS X
Our developers use either Docker or VirtualBox (with Vagrant) to test their code locally (and the problem happens with both). To facilitate this, we modify /etc...
タイトルとURLをコピーしました