java.net.UnknownHostException: dc-o.web.leiniao.com: Temporary failure in name resolution

1.现象
Linux系统下部署Java产品的应用,后台报出如下异常,系统报找不到名为dc-o.web.leiniao.com的域名解析

请求地址:http://dc-o.web.leiniao.com/operation/open/request
java.net.UnknownHostException: dc-o.web.leiniao.com: Temporary failure in name resolution
        at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
        at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:929)
        at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1324)
        at java.net.InetAddress.getAllByName0(InetAddress.java:1277)
        at java.net.InetAddress.getAllByName(InetAddress.java:1193)
        at java.net.InetAddress.getAllByName(InetAddress.java:1127)
        at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45)
        at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:112)
        at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:373)
        at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381)
        at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
        at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
        at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
        at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
        at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
        at downurl.JsonPost.send(JsonPost.java:53)
        at downurl.Iputil.run(Iputil.java:55)
        at downurl.Iputil.main(Iputil.java:41)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:109)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88)
java.lang.NullPointerException
        at downurl.Iputil.run(Iputil.java:89)
        at downurl.Iputil.main(Iputil.java:41)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:109)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88)

在这里插入图片描述

2.原因
怀疑为DNS域名解析错误,导致。
3.解决方案
将http://dc-o.web.leiniao.com/operation/open/request更改为具体的ip:端口号
http://116.62.105.207:90/operation/open/request后恢复

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
当你遇到 `java.net.UnknownHostException: rouyi-vue-mysql: Temporary failure in name resolution` 这个错误时,它通常表示Java应用程序在尝试连接到网络上一个名为 `rouyi-vue-mysql` 的主机时遇到了问题。具体来说,`Temporary failure in name resolution` 提示表明域名解析未能成功,可能是由于以下几个原因: 1. DNS解析问题:DNS服务器可能暂时无法将域名 `rouyi-vue-mysql` 映射为IP地址,或者是网络连接问题导致的DNS查询延迟或失败。 2. IP地址配置错误:如果你的应用期望使用特定的IP地址而不是域名,那么检查应用中是否正确配置了目标服务器的IP。 3. 服务器不可达:目标服务器可能因为维护、宕机或其他网络问题导致暂时无法访问。 4. 网络防火墙或安全组设置:检查你的防火墙规则或安全组设置,确认是否阻止了对目标IP或端口的访问。 5. 本地hosts文件问题:确认hosts文件中没有阻止对这个域名的解析。 为了调试这个问题,你可以尝试以下步骤: 1. 检查网络连接:确保你的设备能够正常访问互联网。 2. PING目标地址:在命令行中运行 `ping rouyi-vue-mysql` 来测试网络连通性。 3. 查看系统日志:查看系统日志(如Windows的Event Viewer或Linux的/var/log)中的相关错误信息。 4. 如果使用的是容器环境,确保Docker网络配置正确。 5. 确认应用程序的连接配置:检查代码中的URL或配置文件,确保正确的域名或IP被指定。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值