系统是wince,我在应用程序上ping域名不通,ping外网IP或者局域网IP则没有问题。我使用的DM9000的网卡驱动,而且采用的是动态分配IP地址的方式联网。动态得到的IP地址信息,反应在注册表上如下:
[HKEY_LOCAL_MACHINE\Comm\DM9CE1\Parms\TcpIp]
"LeaseObtainedHigh"=dword:01cad558
"LeaseObtainedLow"=dword:29e21080
"DhcpSubnetMask"="255.255.255.0"
"DhcpIPAddress"="192.168.6.203"
"AutoInterval"=dword:0000012c
"AutoMask"="255.255.0.0"
"AutoSubnet"="169.254.0.0"
"AutoIP"="0.0.0.0"
"AutoSeed"=dword:00000000
"PrevReqOptions"=hex:\
07,01,03,06,0f,2c,2e,2f
"T2"=dword:0000875a
"T1"=dword:00004d58
"Lease"=dword:00009ab0
"DhcpDNS"=hex(7):\
32,30,32,2e,31,30,33,2e,32,32,34,2e,36,38,00,32,30,32,2e,31,30,33,2e,32,32,\
35,2e,36,38,00,00,00,00,00,00
"DhcpDefaultGateway"="192.168.6.1"
"DhcpServer"="192.168.6.1"
"AutoCfg"=dword:00000001
"EnableDHCP"=dword:00000001
"Subnetmask"=hex(7):\
32,35,35,2e,32,35,35,2e,32,35,35,2e,30,00,f3,75,08,3f,3f,3f,01,00,00,00,00,\
00,00
"DefaultGateway"=hex(7):\
31,39,32,2e,31,36,38,2e,36,2e,31,00,00,00,00
"IpAddress"=hex(7):\
31,39,32,2e,31,36,38,2e,36,2e,37,31,00,01,f3,75,08,3f,3f,3f,01,00,00,00,00,\
00,00
"LLInterface"=""
"UseZeroBroadcast"=dword:00000000
"DNS"="192.168.6.1"
有些数据导出来是16进制表示的。有点难看。其中"DhcpDNS"是"202.103.224.68"。不知道是不是域名服务器的地址就是放在这一项的呢?如果是,我怎么会ping不通域名,如果不是应该怎么才能ping通呢?
是我搞错了,ICMP打包哪里对地址进行转换判断出错。其实使用动态获取地址gethostbyname是可以获取Ip地址的。现在我想知道的是如果我自己设置静态的IP地址,域名服务器应该怎么设置呢?设置注册表的哪一项呢?