[PR #902] [MERGED] Feat fake dns address #13126

Closed
opened 2026-08-05 02:07:31 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/902
Author: @gigovich
Created: 5/25/2023
Status: Merged
Merged: 6/8/2023
Merged by: @gigovich

Base: mainHead: feat-fake-dns-address


📝 Commits (10+)

  • 4e09986 WIP: Add DNS packet catch hook for filtering
  • dad0a3c Full chain code for fake DNS feature, not tested.
  • ab31251 Write DNS response to Device
  • 8e66c0b Send UDP packet with DNS info as response.
  • ddde7ae Add extra test for NextRead
  • 0e3e06e Full working state
  • 5275f6e Add UDP packet hook test
  • 9869262 Add unit test for DNS response writer.
  • 5bf4e2b Remove DNS hook
  • dddfd27 Right handle DNS update from management

📊 Changes

17 files changed (+721 additions, -57 deletions)

View changed files

📝 client/firewall/uspfilter/rule.go (+2 -0)
📝 client/firewall/uspfilter/uspfilter.go (+63 -2)
📝 client/firewall/uspfilter/uspfilter_test.go (+146 -14)
📝 client/internal/acl/manager.go (+1 -1)
📝 client/internal/acl/manager_test.go (+2 -2)
📝 client/internal/acl/mocks/iface_mapper.go (+6 -6)
client/internal/dns/response_writer.go (+103 -0)
client/internal/dns/response_writer_test.go (+93 -0)
📝 client/internal/dns/server_nonandroid.go (+90 -4)
client/internal/dns/server_nonandroid_test.go (+31 -0)
📝 client/internal/dns/server_test.go (+2 -2)
📝 iface/device_wrapper.go (+11 -2)
📝 iface/device_wrapper_test.go (+16 -10)
📝 iface/iface.go (+23 -4)
iface/mocks/README.md (+7 -0)
📝 iface/mocks/filter.go (+38 -10)
iface/mocks/iface/mocks/filter.go (+87 -0)

📄 Description

Describe your changes

Add DNS packet catch hook.
Rename SetFiltering to SetFilter.
Add DNS response writer.
Handle userspace network in fake DNS server.

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/902 **Author:** [@gigovich](https://github.com/gigovich) **Created:** 5/25/2023 **Status:** ✅ Merged **Merged:** 6/8/2023 **Merged by:** [@gigovich](https://github.com/gigovich) **Base:** `main` ← **Head:** `feat-fake-dns-address` --- ### 📝 Commits (10+) - [`4e09986`](https://github.com/netbirdio/netbird/commit/4e09986d2cfec019a285eee618f1d575f306e872) WIP: Add DNS packet catch hook for filtering - [`dad0a3c`](https://github.com/netbirdio/netbird/commit/dad0a3cc38d7d2277ea3153578f04ec384ee7b2d) Full chain code for fake DNS feature, not tested. - [`ab31251`](https://github.com/netbirdio/netbird/commit/ab31251ed9924eca6539eb7993a65ca02b71e854) Write DNS response to Device - [`8e66c0b`](https://github.com/netbirdio/netbird/commit/8e66c0b01737cd7e46896988fb0ec313b2a391e8) Send UDP packet with DNS info as response. - [`ddde7ae`](https://github.com/netbirdio/netbird/commit/ddde7aeba2d9632d2353fd7055c709c01501e225) Add extra test for NextRead - [`0e3e06e`](https://github.com/netbirdio/netbird/commit/0e3e06e9e015c3e63bb82d16add30acfb2291a83) Full working state - [`5275f6e`](https://github.com/netbirdio/netbird/commit/5275f6e6fba917f5fdf641941e1f767ac486b1bf) Add UDP packet hook test - [`9869262`](https://github.com/netbirdio/netbird/commit/98692624a73c9df4224a3b893bca10c8f0790834) Add unit test for DNS response writer. - [`5bf4e2b`](https://github.com/netbirdio/netbird/commit/5bf4e2b59548a7356081a26b5ccfbe2b4beb2813) Remove DNS hook - [`dddfd27`](https://github.com/netbirdio/netbird/commit/dddfd27ba760c8edf864345bbcfad17f9d227509) Right handle DNS update from management ### 📊 Changes **17 files changed** (+721 additions, -57 deletions) <details> <summary>View changed files</summary> 📝 `client/firewall/uspfilter/rule.go` (+2 -0) 📝 `client/firewall/uspfilter/uspfilter.go` (+63 -2) 📝 `client/firewall/uspfilter/uspfilter_test.go` (+146 -14) 📝 `client/internal/acl/manager.go` (+1 -1) 📝 `client/internal/acl/manager_test.go` (+2 -2) 📝 `client/internal/acl/mocks/iface_mapper.go` (+6 -6) ➕ `client/internal/dns/response_writer.go` (+103 -0) ➕ `client/internal/dns/response_writer_test.go` (+93 -0) 📝 `client/internal/dns/server_nonandroid.go` (+90 -4) ➕ `client/internal/dns/server_nonandroid_test.go` (+31 -0) 📝 `client/internal/dns/server_test.go` (+2 -2) 📝 `iface/device_wrapper.go` (+11 -2) 📝 `iface/device_wrapper_test.go` (+16 -10) 📝 `iface/iface.go` (+23 -4) ➕ `iface/mocks/README.md` (+7 -0) 📝 `iface/mocks/filter.go` (+38 -10) ➕ `iface/mocks/iface/mocks/filter.go` (+87 -0) </details> ### 📄 Description ## Describe your changes Add DNS packet catch hook. Rename SetFiltering to SetFilter. Add DNS response writer. Handle userspace network in fake DNS server. ## Issue ticket number and link ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [x] It is a refactor - [ ] Created tests that fail without the change (if possible) - [ ] Extended the README / documentation, if necessary --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 02:07:31 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#13126