2

I am using paypal NVP api in an ecommerce website. It was working fine before but now it is throwing "System.Net.WebException: The remote name could not be resolved: 'api-3t.sandbox.paypal.com'" Exception. I also tried api.sandbox.paypal.com but no luck. Any ideas?

Thanks

Update : Same codes works if my client runs it from his system.

4

1 回答 1

4

这是一个 DNS 问题,或者至少,这就是异常所指向的问题。运行您的代码但失败的机器无法将主机名“api-3t.sandbox.paypal.com”解析为 IP 地址。

潜在问题,按可能性排序:

  • 您的机器没有正确配置 DNS 服务器。
  • 您的计算机正在使用过滤查询的 DNS 服务器。
    • 这在公司环境中很常见;过滤是为了试图阻止恶意软件工作。
  • 您的机器确实配置了 DNS 服务器,但是,该服务器可能拒绝执行递归查询
    • 这是典型的“仅权威”DNS 服务器。
  • 您的代码以某种方式滥用了本地 DNS 查询 API。
  • Paypal 的 DNS 服务器已损坏。

您可以在该机器上启动命令提示符并查看正常的 DNS 解析是否有效:

c:\>nslookup api-3t.sandbox.paypal.com
Server:  google-public-dns-a.google.com.
Address:  8.8.8.8

Non-authoritative answer:
Name:    api-3t.sandbox.paypal.com
Address:  173.0.82.83

如果您想尝试绕过您机构的 DNS 服务器进行测试,您可以重新配置您的计算机以使用 Google 的公共 DNS 服务器 8.8.8.8。

于 2014-07-15T16:54:22.270 回答