显示所有当前的 TCP/IP 网络配置值,并刷新动态主机配置协议 (DHCP) 和域名系统 (DNS) 设置。 Used without parameters, ipconfig displays Internet Protocol version 4 (IPv4) and IPv6 addresses, subnet mask, and default gateway for all adapters.
Syntax
ipconfig [/allcompartments] [/all] [/renew [<adapter>]] [/release [<adapter>]] [/renew6[<adapter>]] [/release6 [<adapter>]] [/flushdns] [/displaydns] [/registerdns] [/showclassid <adapter>] [/setclassid <adapter> [<classID>]]
Parameters
Parameter | Description |
---|---|
/all | 显示所有适配器的完整 TCP/IP 配置。 适配器可表示物理接口(例如已安装的网络适配器)或逻辑接口(如拨号连接)。 |
/displaydns | 显示 DNS 客户端解析程序缓存的内容,包括从本地 Hosts 文件预先加载的条目以及任何最近获得的关于计算机解析的名称查询的资源记录。 DNS 客户端服务使用此信息快速解析经常查询的名称,然后查询其配置的 DNS 服务器。 |
/flushdns | 刷新和重置 DNS 客户端解析程序缓存的内容。 在 DNS 故障排除期间,可以使用此过程丢弃缓存中的负缓存条目,以及已动态添加的任何其他条目。 |
/registerdns | 为计算机上配置的 DNS 名称和 IP 地址启动手动动态注册。 可以使用此参数对失败的 DNS 名称注册进行故障排除,或者解决客户端与 DNS 服务器之间的动态更新问题,而无需重新启动客户端计算机。 TCP/IP 协议的高级属性中的 DNS 设置确定在 DNS 中注册的名称。 |
/release [<adapter>] |
Sends a DHCPRELEASE message to the DHCP server to release the current DHCP configuration and discard the IP address configuration for either all adapters (if an adapter is not specified) or for a specific adapter if the adapter parameter is included. 此参数禁用配置为自动获取 IP 地址的适配器的 TCP/IP。 To specify an adapter name, type the adapter name that appears when you use ipconfig without parameters. |
/release6[<adapter>] |
Sends a DHCPRELEASE message to the DHCPv6 server to release the current DHCP configuration and discard the IPv6 address configuration for either all adapters (if an adapter is not specified) or for a specific adapter if the adapter parameter is included. 此参数禁用配置为自动获取 IP 地址的适配器的 TCP/IP。 To specify an adapter name, type the adapter name that appears when you use ipconfig without parameters. |
/renew [<adapter>] |
Renews DHCP configuration for all adapters (if an adapter is not specified) or for a specific adapter if the adapter parameter is included. 此参数仅在具有配置为自动获取 IP 地址的适配器的计算机上可用。 To specify an adapter name, type the adapter name that appears when you use ipconfig without parameters. |
/renew6 [<adapter>] |
Renews DHCPv6 configuration for all adapters (if an adapter is not specified) or for a specific adapter if the adapter parameter is included. 此参数仅在具有配置为自动获取 IPv6 地址的适配器的计算机上可用。 To specify an adapter name, type the adapter name that appears when you use ipconfig without parameters. |
/setclassid <adapter>[<classID>] |
为指定适配器配置 DHCP 类 ID。 To set the DHCP class ID for all adapters, use the asterisk (*) wildcard character in place of adapter. 此参数仅在具有配置为自动获取 IP 地址的适配器的计算机上可用。 如果未指定 DHCP 类 ID,则删除当前类 ID。 |
/showclassid <adapter> |
显示指定适配器的 DHCP 类 ID。 To see the DHCP class ID for all adapters, use the asterisk (*) wildcard character in place of adapter. 此参数仅在具有配置为自动获取 IP 地址的适配器的计算机上可用。 |
/? | 在命令提示符下显示帮助。 |
Remarks
此命令在配置为自动获取 IP 地址的计算机上最有用。 这使用户能够确定 DHCP、自动专用 IP 寻址 (APIPA) 或备用配置都配置了哪些 TCP/IP 配置值。
If the name you supply for adapter contains any spaces, use quotation marks around the adapter name (for example, "adapter name").
For adapter names, ipconfig supports the use of the asterisk (*) wildcard character to specify either adapters with names that begin with a specified string or adapters with names that contain a specified string. 例如,
Local*
匹配以字符串 Local 开头的所有适配器,*Con*
匹配包含字符串 Con 的所有适配器。
Examples
若要显示所有适配器的基本 TCP/IP 配置,请键入:
ipconfig
若要显示所有适配器的完整 TCP/IP 配置,请键入:
ipconfig /all
若要仅为本地连接适配器续订 DHCP 分配的 IP 地址配置,请键入:
ipconfig /renew Local Area Connection
若要在排查 DNS 名称解析问题时刷新 DNS 解析器缓存,请键入:
ipconfig /flushdns
若要显示名称以 Local 开头的所有适配器的 DHCP 类 ID,请键入:
ipconfig /showclassid Local*
若要将本地连接适配器的 DHCP 类 ID 设置为 TEST,请键入:
ipconfig /setclassid Local Area Connection TEST