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

On ARM devices, DNS always resolves IPV6 ::1 by default #223

Open
zisain opened this issue Jul 28, 2024 · 9 comments
Open

On ARM devices, DNS always resolves IPV6 ::1 by default #223

zisain opened this issue Jul 28, 2024 · 9 comments
Labels
help wanted Extra attention is needed Needs more info

Comments

@zisain
Copy link

zisain commented Jul 28, 2024

Unable to specify dns resolution, resulting in the inability to connect to the target correctly. Only after pinging and resolving to the correct address, and tcping -4 x.x.x.x 80 can the correct result be obtained. It is recommended to add the specified dns parameter or the built-in dns server address. The -4 parameter automatically selects the IPV4 dns resolution, and the -6 parameter automatically selects the IPV6 dns resolution.

@zisain
Copy link
Author

zisain commented Jul 28, 2024

微信图片_20240728124559

@pouriyajamshidi
Copy link
Owner

Hi @zisain,

Thanks for reporting this.

Unfortunately I do not have an ARM device to test this out for myself, making it very difficult to work on.

I will keep this open to see if someone with the same issue and an ARM device can help out.

@SYSHIL
Copy link
Contributor

SYSHIL commented Jul 28, 2024

Hi @pouriyajamshidi I'm totally new to this project but I'm familiar with golang and have an ARM device.
Could I pick this up as a first issue? I'll try and collect more info from the problem posted above but any guidelines to get started with the project would be super helpful :)

@pouriyajamshidi
Copy link
Owner

Hi @SYSHIL,

Thanks for reaching out and willing to help out here. It is much appreciated.

You are more than welcome to work on this.

The name resolution logic is pretty simple. Here are the specific locations in the code base:

func resolveHostname(tcping *tcping) netip.Addr {

func selectResolvedIP(tcping *tcping, ipAddrs []netip.Addr) netip.Addr {

I suggest first running this on your own with -4 and -6 flags and after getting familiar with the logic, try to reproduce this issues.

although, I suspect it is an "Android thing" and not related to ARM.

Let's see.

@zisain
Copy link
Author

zisain commented Jul 30, 2024

Since I don't know golang, I found a discontinued version from other developers for your reference. He used the -D parameter to specify DNS to solve the problem of the system selecting the loopback address as dns, or not having permission to obtain the /proc/net/dev directory permission problem after android12. This is the version description of https://github.com/cloverstd/tcping/releases. As you said, this is an issue with android, but I don't understand how it happened. I'm very sorry.
微信图片_20240730160337

@SYSHIL
Copy link
Contributor

SYSHIL commented Jul 30, 2024

Thanks for the information @zisain
Not sure if there's much I can do here then, @pouriyajamshidi would love to work on anything else that the project will need help with !

@pouriyajamshidi
Copy link
Owner

No worries @zisain. Thanks for reporting this. We can still see the other tcping is able to handle this.

@SYSHIL, thanks a lot. Just out of curiosity, were you able to run it on your own without issues?

@SYSHIL
Copy link
Contributor

SYSHIL commented Aug 2, 2024

Hi @pouriyajamshidi yeah I was able to run it just fine :)
attaching some ouput from my terminal.

ilhan@syeds-MacBook-Pro tcping % tcping -4 www.baidu.com 80
TCPinging www.baidu.com on port 80
Reply from www.baidu.com (45.113.192.101) on port 80 TCP_conn=1 time=38.974 ms
Reply from www.baidu.com (45.113.192.101) on port 80 TCP_conn=2 time=38.509 ms
Reply from www.baidu.com (45.113.192.101) on port 80 TCP_conn=3 time=37.476 ms
Reply from www.baidu.com (45.113.192.101) on port 80 TCP_conn=4 time=38.185 ms
Reply from www.baidu.com (45.113.192.101) on port 80 TCP_conn=5 time=40.920 ms
Reply from www.baidu.com (45.113.192.101) on port 80 TCP_conn=6 time=40.863 ms
Reply from www.baidu.com (45.113.192.101) on port 80 TCP_conn=7 time=40.360 ms

@pouriyajamshidi
Copy link
Owner

Thanks for the info @SYSHIL
Although, I think our friend here is using an Android phone/tablet. Anyway, will keep this open for a while in case someone else can reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed Needs more info
Projects
Status: No status
Development

No branches or pull requests

3 participants