Unexpected DNS resolve procedure if dual stack enviroment and multiple subdomain exists
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 12k
- Forks
- 3.5k
- Avg merge
- 12h 55m
- Merged PRs (30d)
- 6
Description
Dear libevent expert,
We have faced one issue when use libevent to resolve DNS in K8s enviroment.
As you know, K8s will generate multiple subdomain in /etc/resolv.conf as below:
$ cat /etc/resolv.conf
search a.b.c b.c c
Imagine we want to resolve "google" host, and only "google.a.b.c" IPV6 has been configured in K8S dns server. The resolve procedure is as below:
As above diagram depicted, even if the IPV6 address of "google.a.b.c" has been resolved, libevent still wait for IPV4 address of "google.a.b.c", "google.b.c", "google.c", finally "google" from root DNS server. It's unexpected and errorous: if root DNS server gives us some IP of "google", we will get IPV6/IPV4 of 2 different host: "google.a.b.c" and "google".
The correct procedure should as below (seems Linux getaddrinfo() works in this manner)
Please check if this a known issue and any plan to fix this?
Thanks in advance!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the DNS lookup with the Kubernetes-style search list a.b.c b.c c and the dual-stack responses described in the issue. Compare libevent's current procedure with the expected getaddrinfo()-like behavior, and consider the work done when IPv4 and IPv6 results come from the same search-domain candidate rather than being combined across candidates.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100