daeuniverse / daeuniverse/dae

[Bug Report] Failed to send udp dns request

Closed
#462 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
6.2k
Forks
404
Avg merge
57m
Merged PRs (30d)
2

Description

### Checks

- [X] I have searched the existing issues
- [X] I have read the documentation
- [X] Is it your first time sumbitting an issue

### Current Behavior

dae can't send udp dns request to upstream.

Feb 21 13:03:22 cm4router dae[1019]: level=trace msg="Choose DNS path" choose="udp+4" ipversions=[4 6] l4protos=[udp] upstream="udp://dns.alidns.com:53" use="223.6.6.6:53"
Feb 21 13:03:22 cm4router dae[1019]: level=trace msg="Received UDP(DNS) 192.168.1.150:10677 <-> 8.8.8.8:53: ssl.gstatic.com. A"
**Feb 21 13:03:22 cm4router dae[1019]: level=debug msg="Failed to write UDP(DNS) packet request." err="write udp 0.0.0.0:45443->[::ffff:223.6.6.6]:53: address ::ffff:223.6.6.6: non-IPv4 address" from="192.168.1.150:48311" mac="ca:21:89:fe:e2:8b" network="udp4(DNS)" pid=0 pname= to="223.6.6.6:53"**
**Feb 21 13:03:22 cm4router dae[1019]: level=warning msg="handlePkt: failed to read from: 223.6.6.6:53 (dialer: direct): read udp 0.0.0.0:60382: i/o timeout"**
Feb 21 13:03:22 cm4router dae[1019]: level=trace msg="Request to DNS upstream" question=[{mail.google.com. 1 1}] upstream="udp://dns.alidns.com:53"
Feb 21 13:03:22 cm4router dae[1019]: level=trace msg="Choose DNS path" choose="udp+4" ipversions=[4 6] l4protos=[udp] upstream="udp://dns.alidns.com:53" use="223.6.6.6:53"

### Expected Behavior

Succeeded

### Steps to Reproduce

dae is running inside netns and bind `veth0 (netns)` as lan.
Packet forward path: `end0 --> br0 --> veth0 --> veth0 (netns) --> (dae) --> veth0 --> br0 --> end0`
Outgoing path from netns: `veth0 (netns) --> veth0 --> br0 --> end0 (snat)`

```
global{
log_level: trace
lan_interface: veth0
auto_config_kernel_parameter: true
}
dns {
upstream {
googledns: 'tcp+udp://dns.google.com:53'
alidns: 'udp://dns.alidns.com:53'
}
routing {
request {
fallback: alidns
}
response {
upstream(googledns) -> accept

ip(geoip:private) && !qname(geosite:cn) -> googledns
fallback: accept
}
}
}
routing {
fallback: direct
}
```

### Environment

- **Dae version (use `dae --version`)**: v0.5.1
- **OS (e.g `cat /etc/os-release`)**: NixOS 23.11
- **Kernel (e.g. `uname -a`)**: 6.1.21
- **Others**: NA

### Anything else?

1. No nft rule set in the netns.
2. Doesn't see any outgoing udp packet `tcpdump -nn -i veth0`.
3. TCP DNS works fine.
4. `nslookup xxx 223.6.6.6` works fine in the `veth0 (netns)`. This isn't go through the dae as expected because wan isn't binded.
5. No daens created and 0.4.0 has the same issue.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the failure with dae v0.5.1 inside the described network namespace and configuration, then inspect the logged UDP write error involving the IPv4-mapped address. Compare the UDP and TCP DNS paths and verify completion by observing a successful UDP upstream request and an outgoing packet on veth0.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, linux, nixos
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.