[英]Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found
[英]Unable to connect from IPv6 to IPv4 Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found
从我的iOS应用(设备)向服务器调用API时,出现以下错误。
我的设备已连接到IPv6网络和API,而我正在调用的是IPv4网络。 我使用swift创建了该应用,并且我使用Alamofire调用API,并使用Reachability来检查Internet连接。 我该怎么办。 请针对以下错误提出建议。
Request failed with error: Error Domain=NSURLErrorDomain Code=-1003
"A server with the specified hostname could not be found." UserInfo=
{NSErrorFailingURLStringKey=, _kCFStreamErrorCodeKey=8, NSErrorFailingURLKey=,
NSLocalizedDescription=A server with the specified hostname could not
be found., _kCFStreamErrorDomainKey=12, NSUnderlyingError=0x7a08c530
{Error Domain=kCFErrorDomainCFNetwork Code=-1003 "(null)" UserInfo=
{_kCFStreamErrorDomainKey=12, _kCFStreamErrorCodeKey=8}}}
您的应用程序需要检查DNS中的A和AAAA记录。 即使服务器只有一个A记录。 如果您位于仅IPv6的网络上,则本地DNS解析器将模拟AAAA记录,并且您似乎正在从该应用程序连接到IPv6服务器。 网络将在后台处理IPv6到IPv4的转换。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.