メイン コンテンツにスキップ

Windows で IP アドレスを使用してプロキシを設定する

This guide explains how to replace a proxy DNS hostname (e.g.,proxy.company.com) with its IP address on Windows, using either the GUI or PowerShell.

この方法は、次のような状況で役立ちます。

  • DNS 名前解決がブロックされている、または信頼できない
  • ネットワーク遅延または証明書の信頼の問題がパフォーマンスに影響する
  • アクセスを特定の IP アドレスのみに制限する必要がある(egress control)

手動の方法(インターネット オプション)

  1. Control PanelInternet Options を開きます
  2. Connections タブに移動します
  3. LAN Settings をクリックします
  4. Under Proxy server, enable the checkbox:
    • proxy.company.comをプロキシ IP(例:192.168.1.10)に置き換えます
    • ポート(通常は8080)を設定します
  5. OK をクリックし、次に Apply をクリックします

これは、WinINET プロキシ スタックを使用するほとんどのアプリケーション(例:Internet Explorer、Microsoft Edge Legacy、Office アプリ)に適用されます。


スクリプトによる方法(PowerShell)

この PowerShell スクリプトを使用して、IP アドレスを使って WinHTTPWinINET の両方のプロキシ設定を構成します。

# Define proxy IP and port
$proxyIP = "http://192.168.1.10:8080"


# Configure proxy for WinHTTP (used by system services like Intune, Windows Update)
netsh winhttp set proxy $proxyIP ";$bypassList"

# Configure proxy for WinINET (used by most user apps and browsers)
$regPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
Set-ItemProperty -Path $regPath -Name ProxyEnable -Value 1
Set-ItemProperty -Path $regPath -Name ProxyServer -Value $proxyIP
Set-ItemProperty -Path $regPath -Name ProxyOverride -Value $bypassList