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

Added enhancement for custom dns servers and persist changes in localstorage #6

Closed
wants to merge 4 commits into from

Conversation

aattwwss
Copy link

I chanced upon your tool https://dnsspeedtest.online/ when I was trying to benchmark and compare my own Adguard server. However I realised I had to manually edit the script.js to put in a customised DNS server, so I decided to add these enhancements. Should also fix the issue with #5

  1. Support custom DNS server in the web page and added a new icon to edit the dns servers.

main_page
dns_edit_page
added_dns_page

  1. Saved the top websites and dns servers into localstorage so they are persisted through multiple sessions

It is currently deployed at https://speed-doh.static.domains/.

@s1lviu
Copy link
Contributor

s1lviu commented Jun 27, 2024

Hi, @aattwwss, and thanks for your contribution! I appreciate the effort you've put into this. The addition is largely in good shape, but I’d like us to make a few small adjustments to ensure everything works smoothly.

  1. Please add a check for the DoH server concerning CORS and the request method. For example, Cloudflare allows CORS from GET requests. Adding this check will prevent request errors. For the existing list, I checked manually every DoH provider to see what's their convenient way of not getting request errors.
  2. Could you add a header for the DNS list table? This will enhance readability and organization of the data.
  3. Please update the placeholder text for more clarity:
    “Add new dns…” to “DoH server address”
    “Comma separated IP address…” to “Comma separated IPv4 addresses…”

These changes will help maintain consistency and improve user experience.

If you have any questions or need further clarification on the feedback, please feel free to discuss.

Thanks again for your valuable input to the project!

@aattwwss
Copy link
Author

Hi @s1lviu, a couple of questions regarding your comments.

  1. When you say check, do you mean to check it programmatically or to add the allowCors field in the edit table?
  2. I do think if we want to add a header, I would prefer refactoring the list with multiple span to just a HTML table. Do let me know if you are OK with it.

@s1lviu
Copy link
Contributor

s1lviu commented Jul 1, 2024

Hi again @aattwwss,

Hi @s1lviu, a couple of questions regarding your comments.

  1. When you say check, do you mean to check it programmatically or to add the allowCors field in the edit table?

Programmatically.

  1. I do think if we want to add a header, I would prefer refactoring the list with multiple span to just a HTML table. Do let me know if you are OK with it.

Yes, sounds ok, but only that list. For the hosts lists, I would keep it like is now.

Thanks!

@aattwwss
Copy link
Author

aattwwss commented Jul 4, 2024

Hi @s1lviu

Regarding the checking of the dns server, do you have any recommendation as to how to check? Off the top of my head, I am thinking of following this priority:

  1. GET with JSON
  2. POST with binary request

I would also like to seek clarification on using the no-cors mode when querying the dns. Since the response is opaque, how can we be sure that we actually got what we want out of the query?

Cheers

@s1lviu
Copy link
Contributor

s1lviu commented Jul 4, 2024

Hi @aattwwss,

Hi @s1lviu

Regarding the checking of the dns server, do you have any recommendation as to how to check? Off the top of my head, I am thinking of following this priority:

  1. GET with JSON
  2. POST with binary request

The order should be:

  1. POST with CORS – This method prioritizes privacy as it keeps DNS query data within the body of the request.
  2. GET with CORS – Useful for its simplicity and potential for caching.
  3. GET without CORS – While we won't be able to access the response content, this can still be useful for checking server reachability.
  4. POST without CORS – Similar to GET without CORS, this allows us to measure the timing but not inspect the content.

I would also like to seek clarification on using the no-cors mode when querying the dns. Since the response is opaque, how can we be sure that we actually got what we want out of the query?

Cheers

Regarding your query about using the no-cors mode, since the response is opaque, it indeed prevents us from confirming the exact DNS data returned. In such cases where CORS settings lead to opaque responses, if all checks up to the 4th case fail, we will proceed to measure only the timing of responses, assuming that the server supports DoH based on our inability to retrieve but successfully send requests.

As a good read for a more detailed understanding of the protocol and methods involved, I recommend checking out the official documentation on RFC 8484: DNS Queries over HTTPS (DoH).

Thanks!

@s1lviu
Copy link
Contributor

s1lviu commented Jul 18, 2024

Hi @aattwwss,
Any updates?
Thanks!

@aattwwss
Copy link
Author

Hi @s1lviu ,
Apologies, I'm caught up with other work for now. I will try to tackle this again after a couple of weeks.
Sorry for the delay!

@s1lviu
Copy link
Contributor

s1lviu commented Dec 16, 2024

Hi @aattwwss
A small follow-up if it is still a matter of interest to you.
Thanks,
Silviu

@s1lviu s1lviu closed this Dec 19, 2024
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

Successfully merging this pull request may close these issues.

2 participants