Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Name or service not known #379

Closed
luoTianYiYa opened this issue Dec 15, 2022 · 2 comments
Closed

Name or service not known #379

luoTianYiYa opened this issue Dec 15, 2022 · 2 comments

Comments

@luoTianYiYa
Copy link

luoTianYiYa commented Dec 15, 2022

一直报Name or service not known这个错误,虽然在issues中有人也是这个错误,但是跟他的不一样.
运行版本:Python 2.7.5
运行方式:Python run.py
系统环境:CentOS 7

config.json如下:

{
  "$schema": "https://ddns.newfuture.cc/schema/v2.8.json", 
  "debug": true, 
  "dns": "alidns", 
  "id": "aliyunID", 
  "index4": "default", 
  "index6": "default", 
  "ipv4": [
    "xxx.xxxx.top"
  ], 
  "ipv6": [], 
  "proxy": null, 
  "token": "secret key", 
  "ttl": 600
} 

DEBUG日志如下:

[root@localhost DDNS-master]# python run.py 
DDNS[ ${BUILD_VERSION}@${BUILD_DATE} ] run: posix linux2
Configuration was loaded from <== /www/DDNS-master/config.json
========================= Thu Dec 15 11:41:26 2022 =========================
2022-12-15 11:41:26,276 <cache.load> 48@/www/DDNS-master/util/cache.py 
[DEBUG] load cache data from /tmp/ddns.cache
2022-12-15 11:41:26,277 <run.main> 146@run.py 
[WARNING] Cache file is out of dated.

Thu Dec 15 11:41:26 2022 xxx.xxxx.top(A) ==> IP [via DIRECT]
2022-12-15 11:41:26,277 <alidns.update_record> 148@/www/DDNS-master/dns/alidns.py 
[DEBUG] >>>>>xxxx.xxxx.top(A)
2022-12-15 11:41:26,277 <alidns.signature> 58@/www/DDNS-master/dns/alidns.py 
[DEBUG] AccessKeyId=AccessKeyId&Action=GetMainDomainName&Format=json&InputString=xxx.xxxx.top&SignatureMethod=HMAC-SHA1&SignatureNonce=xxxxxxxxxx&SignatureVersion=1.0&Timestamp=2022-12-15T03%3A41%3A26Z&Version=2015-01-09
2022-12-15 11:41:26,277 <alidns.signature> 60@/www/DDNS-master/dns/alidns.py 
[DEBUG] signString: POST&%2F&AccessKeyId%3Dxxxxxxxxxxxxx(x为AccessKeyId)%26Action%3DGetMainDomainName%26Format%3Djson%26InputString%3Dxxx.xxx.top%26SignatureMethod%3DHMAC-SHA1%26SignatureNonce%3Dxxxxxxxxxxxxxxxxxxx6SignatureVersion%3D1.0%26Timestamp%3D2022-12-15T03%253A41%253A26Z%26Version%3D2015-01-09
2022-12-15 11:41:26,277 <alidns.request> 77@/www/DDNS-master/dns/alidns.py 
[INFO] alidns.aliyuncs.com: {'SignatureVersion': '1.0', 'Format': 'json', 'Timestamp': '2022-12-15T03:41:26Z', 'InputString': u'xxx.xxxx.top', 'AccessKeyId': u'AccessKeyId', 'SignatureMethod': 'HMAC-SHA1', 'Version': '2015-01-09', 'Signature': 'xxxxxxxxxxxxxx', 'Action': 'GetMainDomainName', 'SignatureNonce': UUID('xxxxxxxxxxxxxxxxxxxx')}
2022-12-15 11:41:26,296 <run.change_dns_record> 81@run.py 
[ERROR] [Errno -2] Name or service not known
2022-12-15 11:41:26,296 <cache.sync> 85@/www/DDNS-master/util/cache.py 
[DEBUG] save cache data to /tmp/ddns.cache```


@laozhoubuluo
Copy link
Contributor

可以试试按照 #373 改下文件,完了本地拉个 Python 环境跑一下试试。

@luoTianYiYa
Copy link
Author

问题已解决,问题是由于我自己的粗心大意,没有配置路由网关导致的,ping不同外网,后面我添加后就可以ping通了,服务也可以正常运行了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants