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

系統未設定 DNS2 時出現錯誤訊息 #15

Closed
bestpika opened this issue May 12, 2019 · 11 comments
Closed

系統未設定 DNS2 時出現錯誤訊息 #15

bestpika opened this issue May 12, 2019 · 11 comments
Labels
bug Something isn't working

Comments

@bestpika
Copy link

bestpika commented May 12, 2019

config.json

{
  "Listen": "127.0.0.1",
  "SecondDns": "139.175.1.1",
  "BlackList": false,
  "RewriteList": false,
  "DebugLog": true,
  "EDnsCustomize": false,
  "EDnsClientIp": "0.0.0.0",
  "ProxyEnable": false,
  "HttpsDns": "https://dns.google.com/resolve",
  "SecondHttpsDns": "https://dns.cloudflare.com/dns-query",
  "Proxy": "127.0.0.1:1080",
  "EnableDnsCache": true,
  "EnableDnsMessage": false,
  "EnableHttp2": true
}

我試著只設定系統的 DNS1: 127.0.0.1 時執行出現如圖的錯誤訊息
image

log

| 2019-05-12 12:25:32 127.0.0.1 : whatismyip.akamai.com. | A
| System.NullReferenceException: 並未將物件參考設定為物件的執行個體。
   於 AuroraGUI.DnsSvr.QueryResolve.<ServerOnQueryReceived>d__0.MoveNext()
Try Connect:System.Net.WebException: 無法解析遠端名稱: 'whatismyip.akamai.com'
   於 System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
   於 System.Net.WebClient.DownloadString(Uri address)
   於 System.Net.WebClient.DownloadString(String address)
   於 AuroraGUI.Tools.IpTools.GetIntIp()

這狀況看起來是連 AuroraDNS 要去查的時候也走了 127.0.0.1
但是卻沒有經過裡面設定的 139.175.1.1 這個 DNS

版本 | 190501

@mili-tan mili-tan added the bug Something isn't working label May 14, 2019
@mili-tan
Copy link
Owner

感谢反馈,已经尝试修正了,应该最近会Release

@mili-tan
Copy link
Owner

已经Release了,如果还有问题欢迎继续反馈。

@bestpika
Copy link
Author

bestpika commented May 15, 2019

image

Try Connect:System.Net.Sockets.SocketException (0x80004005): 無法識別這台主機。
   於 System.Net.Dns.GetAddrInfo(String name)
   於 System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
   於 System.Net.Dns.GetHostAddresses(String hostNameOrAddress)
   於 System.Net.Sockets.TcpClient.Connect(String hostname, Int32 port)
   於 AuroraGUI.Tools.IpTools.GetLocIp()

雖然按下確定後可以用,可是這樣看不出有沒有正確使用那台

@bestpika
Copy link
Author

bestpika commented May 15, 2019

然後我在圖示上右鍵點重新啟動會出現跟之前一樣的錯誤
image

Try Connect:System.Net.WebException: 無法解析遠端名稱: 'whatismyip.akamai.com'
   於 System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
   於 System.Net.WebClient.DownloadString(Uri address)
   於 System.Net.WebClient.DownloadString(String address)
   於 AuroraGUI.Tools.IpTools.GetIntIp()

@mili-tan
Copy link
Owner

图片
似乎是您的辅DNS服务器 139.175.1.1 有问题 不能正常解析呢
这应该是台湾远传Seednet的DNS?
您可以换用其他DNS(8.8.8.8或者1.1.1.1 亦或是TWNIC的101.101.101.101)来试试看能否正常使用?

@bestpika
Copy link
Author

bestpika commented May 15, 2019

這台 DNS 有限制該 ISP 的用戶才可使用
可是我 SecondDns 改成 8.8.8.8 或 168.95.1.1 也會遇到相同的問題

@bestpika
Copy link
Author

bestpika commented May 15, 2019

開啟 debug log 會得到這樣的訊息

Try Connect:System.Net.WebException: 無法解析遠端名稱: 'whatismyip.akamai.com'
   於 System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
   於 System.Net.WebClient.DownloadString(Uri address)
   於 System.Net.WebClient.DownloadString(String address)
   於 AuroraGUI.Tools.IpTools.GetIntIp()
| 2019-05-15 17:58:27 127.0.0.1 : whatismyip.akamai.com. | A
| 2019-05-15 17:58:27 127.0.0.1 : whatismyip.akamai.com. | A
| -- Startup SecondDns : 168.95.1.1
| -- Startup SecondDns : 168.95.1.1

@bestpika
Copy link
Author

bestpika commented May 15, 2019

就我的觀察,應該是在「啟動」的時候要先走 SecondDns 查詢後再走 DoH 的伺服器才對
但是這隻程式不管怎樣都是直接走系統 DNS 後出錯才走 SecondDns 所以才會出現錯誤訊息
在另一個類似的程式裡,這個啟動查詢時使用的 DNS 伺服器被稱為 Bootstrap DNS

@mili-tan
Copy link
Owner

mili-tan commented May 15, 2019

是这样的 但是在我本地没有遇到这样的问题呢……
我在最开始的考量是 为了防止程序陷入查询DoH服务器的域名的循环
设置了排开DoH服务器的域名和WhatIsMyIP-API的域名 由本程序使用标准查询向SecondDns查询以后返回给系统
但是似乎在您的环境下并没有很好的工作呢…我会在研究下的…
另外关于DoH是否生效,您大可放心,因为SecondDns只会排开DoH服务器的域名和WhatIsMyIP-API的域名,以及在程序出错的时候使用,再其他时候均由DoH查询。

@bestpika
Copy link
Author

那能讓他啟動的時候先重試查詢幾次
這幾次都失敗再跳錯誤訊息嗎?

@mili-tan
Copy link
Owner

已经做了一些更改
第二次失败后将换用内部解析后的IP来连接 然后再失败后才会弹出错误提示
应该下月初会Release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants