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

How to setup it to proxy DNS query? #536

Closed
adrianzhang opened this issue Jul 24, 2024 · 5 comments
Closed

How to setup it to proxy DNS query? #536

adrianzhang opened this issue Jul 24, 2024 · 5 comments

Comments

@adrianzhang
Copy link

English Only.

I'v already created tunnel for some udp and tcp applications successfully.
But I am stuck at making DNS query through tunnel, eg. query google.com from 8.8.8.8.
Would you please give me an example to set it up?
Any help is appreciated.

@adrianzhang
Copy link
Author

BTW, what i am trying to setup is an Unbound recursive DNS server, it query records from many upstream DNS servers (not only 8.8.8.8).

@pereiravagner96
Copy link

Udp2raw is a transparent transmission tool. It should not matter at all the type of content on its payload. If you are encountering issues with DNS or any other applications it might be due to MTU issues. So perhaps you need to add MTU clamping rules to adjust the MTU. DNS uses both UDP and TCP protocol. Some large queries will surpass the 512 Byte maximum size determined by the protocol. From this point and beyond the DNS protocol will use TCP to fragment the query in multiple packets. Please test and come back with the results so we can learn more.

@wangyu-
Copy link
Owner

wangyu- commented Jul 25, 2024

if you are using only udp2raw, you need to setup a separate tunnel forwarding DNS. You cannot use the same tunnel for your application and remote DNS.

Other possible easier way:

1 use udp2raw+VPN, query dns over VPN

2 user udp2raw+shadowsocks (turn udp2raw into socks5), then query via socks5. Also, many ss clients have a feature named "remote DNS", it can do remote DNS automatically for you.

@adrianzhang
Copy link
Author

Udp2raw is a transparent transmission tool. It should not matter at all the type of content on its payload. If you are encountering issues with DNS or any other applications it might be due to MTU issues. So perhaps you need to add MTU clamping rules to adjust the MTU. DNS uses both UDP and TCP protocol. Some large queries will surpass the 512 Byte maximum size determined by the protocol. From this point and beyond the DNS protocol will use TCP to fragment the query in multiple packets. Please test and come back with the results so we can learn

Thanks. What I suppose is, an Unbound recursive DNS server will request records to Root DNS servers/TLD DNS servers/Domain authoritative DNS servers, and requests go through udp2raw tunnel if upstream servers located outside China. However, I don't know how to setup udp2raw because I only learned redirect ports of VPS applications from udp2raw docs.

@adrianzhang
Copy link
Author

adrianzhang commented Jul 25, 2024

if you are using only udp2raw, you need to setup a separate tunnel forwarding DNS. You cannot use the same tunnel for your application and remote DNS.

Other possible easier way:

1 use udp2raw+VPN, query dns over VPN1

2 user udp2raw+shadowsocks (turn udp2raw into socks5), then query via socks5. Also, many ss clients have a feature named "remote DNS", it can do remote DNS automatically for you.

Thank you! That makes sense. Your reply remind me to use SS-libev. Cool!

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