From 50267aa042a45381b9633b23d4aeeffd35496851 Mon Sep 17 00:00:00 2001 From: Elvis Souza Date: Fri, 24 Feb 2023 22:02:00 -0300 Subject: [PATCH] Updating the windows running docs (#313) * updating the windows running docs * updating the windows running docs * missing remove when garbage collected * is not necesary to log when -1 is returned at the first byte read * release notes --- RELEASE-NOTES.md | 2 +- .../1-getting-started/running-it/_index.en.md | 23 ++++++++++++++----- gradle.properties | 2 +- .../server/dns/DnsQueryTCPHandler.java | 4 +++- .../dnsproxyserver/server/dns/TCPServer.java | 1 + 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index d38f62a28..35194bd3c 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,6 +1,6 @@ ### 3.2.1-beta * Respecting OS to configure as default DNS - +* Other minor fixes ### 3.2.0-beta * Better error treating and log formatting diff --git a/docs/content/1-getting-started/running-it/_index.en.md b/docs/content/1-getting-started/running-it/_index.en.md index 626e177a0..eefe4c6e5 100644 --- a/docs/content/1-getting-started/running-it/_index.en.md +++ b/docs/content/1-getting-started/running-it/_index.en.md @@ -52,12 +52,19 @@ docker run --name dns-proxy-server -p 5380:5380 -p 53:53/udp \ 2. Change your default internet adapter DNS to `127.0.0.1` * Press `Windows + R` and type `ncpa.cpl` then press **enter** or go to your network interfaces Window -* Change your default internet adapterDNS to `127.0.0.1` by following the below -pictures (sorry they are in portuguese) +* Change your default internet adapter DNS to `127.0.0.1` by following the +pictures below -![Screenshot](https://i.imgur.com/1goUHp0.png?width=10pc&classes=shadow) -![Screenshot](https://i.imgur.com/XKM7JwN.png?width=10pc&classes=shadow) -![Screenshot](https://i.imgur.com/EFno6F6.png?width=10pc&classes=shadow) +![Screenshot](https://i.imgur.com/UAVUgLf.png?width=10pc&classes=shadow) + +Uncheck IPV6 because Windows can try to solve hostnames by using a IPV6 DNS server, +then requests won't be sent to DPS, actually DPS doesn't support IPV6. + +![Screenshot](https://i.imgur.com/DGPdFRD.png?width=10pc&classes=shadow) + +![screenshot](https://i.imgur.com/EcZF6mG.png?width=10pc&classes=shadow) + +![Screenshot](https://i.imgur.com/0bxASqd.png?width=10pc&classes=shadow) ### Testing the DNS server @@ -94,4 +101,8 @@ Address: 172.217.29.206 Start the server at [custom port](#configure-your-dns) and solving from it - nslookup -port=8980 google.com 127.0.0.1 +```bash +$ nslookup -port=8980 google.com 127.0.0.1 +``` + +[1]: https://imgur.com/a/LlDH8AM diff --git a/gradle.properties b/gradle.properties index f8d58098a..98c46a55d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -version=3.2.0-beta +version=3.2.1-beta quarkusPluginId=io.quarkus quarkusPluginVersion=2.16.0.Final quarkusPlatformGroupId=io.quarkus.platform diff --git a/src/main/java/com/mageddo/dnsproxyserver/server/dns/DnsQueryTCPHandler.java b/src/main/java/com/mageddo/dnsproxyserver/server/dns/DnsQueryTCPHandler.java index ebaf7902b..cd1ab4ef7 100644 --- a/src/main/java/com/mageddo/dnsproxyserver/server/dns/DnsQueryTCPHandler.java +++ b/src/main/java/com/mageddo/dnsproxyserver/server/dns/DnsQueryTCPHandler.java @@ -89,7 +89,9 @@ static short readHeaderAndValidate(InputStream in) { for (int i = 0; i < msgSizeBuf.limit(); i++) { final byte read = (byte) in.read(); if (read == -1) { - log.info("status=incompleteHeader, bytes={}", i + 1); + if(i >= 1){ + log.info("status=incompleteHeader, bytes={}", i + 1); + } return -1; } msgSizeBuf.put(i, read); diff --git a/src/main/java/com/mageddo/dnsproxyserver/server/dns/TCPServer.java b/src/main/java/com/mageddo/dnsproxyserver/server/dns/TCPServer.java index dceaeb69d..4ff7f01e4 100644 --- a/src/main/java/com/mageddo/dnsproxyserver/server/dns/TCPServer.java +++ b/src/main/java/com/mageddo/dnsproxyserver/server/dns/TCPServer.java @@ -62,6 +62,7 @@ void watchDog() { final var client = itr.next().get(); if (client == null) { log.debug("status=clientWasGarbageCollected"); + itr.remove(); continue; } MDC.put("clientId", String.valueOf(client.getId()));