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

[BUG]CoreDNS reverse dns query didn't work on AKS 1.32 #4823

Open
Calotte opened this issue Mar 3, 2025 · 0 comments
Open

[BUG]CoreDNS reverse dns query didn't work on AKS 1.32 #4823

Calotte opened this issue Mar 3, 2025 · 0 comments

Comments

@Calotte
Copy link

Calotte commented Mar 3, 2025

Describe the bug
A clear and concise description of what the bug is.
We have a program that will get the pod's dns via dns reverse query, it works in aks 1.31 but on 1.32 it failed with the following error:

2025-03-03T06:54:39.433868+00:00 af80d705-9259-4940-84a6-f30f750da0af directdns debug looking up PTR for 10.240.10.253 using server 10.0.0.10
2025-03-03T06:54:39.438568+00:00 af80d705-9259-4940-84a6-f30f750da0af directdns error invalid response for 10.240.10.253: NXDOMAIN
Optional: Set the appropriate GitHub label(s) to indicate the AKS feature or area you believe your bug relates to.

To Reproduce
Steps to reproduce the behavior:
dig a pod ip's dns.

Also can use this function:
func doServerReverseLookup(ctx context.Context, addr string, server string, logger *log.Entry) ([]string, error) {
logger.Debugf("looking up PTR for %s using server %s", addr, server)
c := dns.Client{}
m := dns.Msg{}
reverseAddr, err := dns.ReverseAddr(addr)
if err != nil {
return nil, fmt.Errorf("could not reverse %s: %v", addr, err)
}
m.SetQuestion(reverseAddr, dns.TypePTR)
r, t, err := c.ExchangeContext(ctx, &m, server+":53")
if err != nil {
return nil, fmt.Errorf("failed to perform PTR lookup for %s: %v", addr, err)
}
logger.Tracef("PTR lookup for %s took %v", addr, t)
if r.Rcode != dns.RcodeSuccess {
return nil, fmt.Errorf("invalid response for %s: %v", addr, dns.RcodeToString[r.Rcode])
}
hosts := make([]string, 0)
for _, ans := range r.Answer {
host := ans.(*dns.PTR).Ptr
if strings.HasSuffix(host, ".") {
host = host[0 : len(host)-1]
}
hosts = append(hosts, host)
}

return hosts, nil

}

  1. Run command '...'
  2. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem. Make sure not to include sensitive or personal information.

Environment (please complete the following information):

  • CLI Version 1.31
  • Kubernetes version 1.32
  • CLI Extension version [e.g. 1.7.5] if applicable
  • Browser [e.g. chrome, safari] is applicable

Additional context
Add any other context about the problem here.

@Calotte Calotte added the bug label Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants