Xml 无法解析服务器名称或地址,原因是什么?

Xml 无法解析服务器名称或地址,原因是什么?,xml,asp-classic,msxml,Xml,Asp Classic,Msxml,我在(www.test1.com)的asp页面中使用以下代码 但我在我的页面中出现了如下错误 msxml3.dll error '80072ee7' The server name or address could not be resolved 但我将请求发送到同一服务器(http://www.test1.com)只有问题。但我向任何其他服务器发送请求,如(http://www.test2.com)工作正常 为什么在同一台服务器上会出现问题?可能是您的web服务器的DNS没有列出自己的名

我在(www.test1.com)的asp页面中使用以下代码

但我在我的页面中出现了如下错误

msxml3.dll error '80072ee7'

The server name or address could not be resolved 
但我将请求发送到同一服务器(http://www.test1.com)只有问题。但我向任何其他服务器发送请求,如(http://www.test2.com)工作正常


为什么在同一台服务器上会出现问题?

可能是您的web服务器的DNS没有列出自己的名称(没错,确实如此!),因此请尝试使用“localhost”或“127.0.0.1”

如果您在此服务器上安装/启用了PHP,下面有一个快速方法来检查它可以解析哪些服务器名称:

<?php

function test() {
    $hostname = isset($_POST['hostname']) ? trim($_POST['hostname']) : false;

    if ($hostname) {
        echo "<h2>Hostname: ", htmlspecialchars($hostname), "</h2>\n";

        if ($addrs = gethostbynamel($hostname)) {
            echo "<div>\n";
            var_dump($addrs);
            echo "</div>\n";
        }
        else {
            echo "<p>No records found.</p>\n";
        }
    }
}

?>
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<title>Test DNS record retrieval</title>
</head>

<body>
<h1>Test DNS record retrieval</h1>
<?php test(); ?>

<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
    <table>
        <tr>
            <th>host name:</th>
            <td><input type="text" tabindex="10" name="hostname" size="40" ></td>
        </tr>
        <tr>
            <td></td>
            <td><input type="submit" tabindex="99"></td>
        </tr>
    </table>
</form>

</body>
</html>

测试DNS记录检索
测试DNS记录检索

您是从经过身份验证的代理服务器后面发出此消息的吗?如果是这样,代理服务器可能会被配置为要求对www.test1.com进行身份验证,但不要求对www.test2.com进行身份验证。
<?php

function test() {
    $hostname = isset($_POST['hostname']) ? trim($_POST['hostname']) : false;

    if ($hostname) {
        echo "<h2>Hostname: ", htmlspecialchars($hostname), "</h2>\n";

        if ($addrs = gethostbynamel($hostname)) {
            echo "<div>\n";
            var_dump($addrs);
            echo "</div>\n";
        }
        else {
            echo "<p>No records found.</p>\n";
        }
    }
}

?>
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<title>Test DNS record retrieval</title>
</head>

<body>
<h1>Test DNS record retrieval</h1>
<?php test(); ?>

<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
    <table>
        <tr>
            <th>host name:</th>
            <td><input type="text" tabindex="10" name="hostname" size="40" ></td>
        </tr>
        <tr>
            <td></td>
            <td><input type="submit" tabindex="99"></td>
        </tr>
    </table>
</form>

</body>
</html>