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 · 1 comment
Open

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

Calotte opened this issue Mar 3, 2025 · 1 comment

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

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
}

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.

@robbiezhang
Copy link
Contributor

CoreDNS issue disccused here:
coredns/coredns#7177

Before the coredns makes a path through, AKS team is evaluating if we should downgrade coredns to 1.11.3 for k8s 1.32 clusters.

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

3 participants