欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

ipconfig的使用

程序员文章站 2022-05-23 22:24:08
...
写道
问:我所在的网络经常出现可以用IP访问却不能用域名访问的问题,除服务器上的设置问题,还有什么原

因可能导致这种问题?
 

 答:我们在访问网站时如果采用域名方式,在进行访问前还需要将你输入的域名通过DNS服务器转换为

IP地址,如果DNS服务器出现故障或无法连接DNS 服务器,就无法获取网站的IP自然而然也就无法访问网

站。为了提高网站访问速度,系统会自动将已经访问过并获取了IP地址的网站存入本地的DNS缓存里,一

旦再对这个网站进行访问,则不再通过DNS服务器而直接从缓存中取出该网站的IP地址进行访问。但有时

就是因为本地DNS缓存出现了问题,而导致了网站无法访问的故障。可以通过在命令行方式(运行CMD.EXE)

下输入命令“ipconfig /flushdns”(不含引号)来重建本地DNS缓存,就能解决这个问题。

 

IPCONFIG命令的使用:

在windows控制台下输入:>ipconfig /?

得到以下结果:



USAGE:

ipconfig [/? | /all | /renew [adapter] | /release [adapter] |

/flushdns | /displaydns | /registerdns |

/showclassid adapter |

/setclassid adapter [classid] ]



where

adapter Connection name

(wildcard characters * and ? allowed, see examples)



Options:

/? Display this help message

/all Display full configuration information.

/release Release the IP address for the specified adapter.

/renew Renew the IP address for the specified adapter.

/flushdns Purges the DNS Resolver cache.

/registerdns Refreshes all DHCP leases and re-registers DNS names

/displaydns Display the contents of the DNS Resolver Cache.

/showclassid Displays all the dhcp class IDs allowed for adapter.

/setclassid Modifies the dhcp class id.



The default is to display only the IP address, subnet mask and

default gateway for each adapter bound to TCP/IP.



For Release and Renew, if no adapter name is specified, then the IP address

leases for all adapters bound to TCP/IP will be released or renewed.



For Setclassid, if no ClassId is specified, then the ClassId is removed.



Examples:

> ipconfig ... Show information.

> ipconfig /all ... Show detailed information

> ipconfig /renew ... renew all adapters

> ipconfig /renew EL* ... renew any connection that has its

name starting with EL

> ipconfig /release *Con* ... release all matching connections,

eg. "Local Area Connection 1" or

"Local Area Connection 2"

  在控制台输入以下命令可以查看有哪些dns缓存:

写道
>ipconfig /displaydns
 
写道


Windows IP Configuration



xtx.kv8.info

----------------------------------------

Record Name . . . . . : xtx.kv8.info

Record Type . . . . . : 1

Time To Live . . . . : 590231

Data Length . . . . . : 4

Section . . . . . . . : Answer

A (Host) Record . . . : 127.0.0.1





fds.ppstream.net

----------------------------------------

Record Name . . . . . : fds.ppstream.net

Record Type . . . . . : 1

Time To Live . . . . : 2493

Data Length . . . . . : 4

Section . . . . . . . : Answer

A (Host) Record . . . : 61.172.196.99





3.joppnqq.com

----------------------------------------

Record Name . . . . . : 3.joppnqq.com

Record Type . . . . . : 1

Time To Live . . . . : 590231

Data Length . . . . . : 4

Section . . . . . . . : Answer

A (Host) Record . . . : 127.0.0.1





1.jopenkk.com

----------------------------------------

Record Name . . . . . : 1.jopenkk.com

Record Type . . . . . : 1

Time To Live . . . . : 590231

Data Length . . . . . : 4

Section . . . . . . . : Answer

A (Host) Record . . . : 127.0.0.1





xxx.m111.biz

----------------------------------------

Record Name . . . . . : xxx.m111.biz

Record Type . . . . . : 1

Time To Live . . . . : 590231

Data Length . . . . . : 4

Section . . . . . . . : Answer

A (Host) Record . . . : 127.0.0.1





1.0.0.127.in-addr.arpa

----------------------------------------

Record Name . . . . . : 1.0.0.127.in-addr.arpa.

Record Type . . . . . : 12

Time To Live . . . . : 590231

Data Length . . . . . : 4

Section . . . . . . . : Answer

PTR Record . . . . . : localhost





Record Name . . . . . : 1.0.0.127.in-addr.arpa.

Record Type . . . . . : 12

Time To Live . . . . : 590231

Data Length . . . . . : 4

Section . . . . . . . : Answer

PTR Record . . . . . : yu.8s7.net

............省略以下打印输出