We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The OVN DNS interception supports providing answers for both forward and reverse DNS lookups on instance names.
However, LXD does currently not populate the database with reverse DNS records.
This causes issues for software that rely on correct reverse DNS lookups to determine FQDN.
Something like this could potentially fix it:
diff --git a/lxd/network/openvswitch/ovn.go b/lxd/network/openvswitch/ovn.go index d15d508253..ff9879d8ae 100644 --- a/lxd/network/openvswitch/ovn.go +++ b/lxd/network/openvswitch/ovn.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "net" + "netip" "os" "strconv" "strings" @@ -1377,6 +1378,7 @@ func (o *OVN) LogicalSwitchPortSetDNS(switchName OVNSwitch, portName OVNSwitchPo // Only include DNS name record if IPs supplied. if len(dnsIPs) > 0 { + lowerDnsName := strings.ToLower(dnsName) var dnsIPsStr strings.Builder for i, dnsIP := range dnsIPs { if i > 0 { @@ -1386,7 +1388,17 @@ func (o *OVN) LogicalSwitchPortSetDNS(switchName OVNSwitch, portName OVNSwitchPo dnsIPsStr.WriteString(dnsIP.String()) } - cmdArgs = append(cmdArgs, fmt.Sprintf(`records={"%s"="%s"}`, strings.ToLower(dnsName), dnsIPsStr.String())) + cmdArgs = append(cmdArgs, fmt.Sprintf(`records={"%s"="%s"`, lowerDnsName, dnsIPsStr.String())) + + for i, dnsIP = range dnsIPs { + addr, ok := netip.AddrFromSlice(dnsIP) + if addr.Is6() { + cmdArgs = append(cmdArgs, fmt.Sprintf(`,"%s"="%s"`, reverse6(dnsIP.String(), lowerDnsName))) + } else { + cmdArgs = append(cmdArgs, fmt.Sprintf(`,"%s"="%s"`, reverse(dnsIP.String(), lowerDnsName))) + } + } + cmdArgs = append(cmdArgs, "}") } dnsUUID = strings.TrimSpace(dnsUUID)
The text was updated successfully, but these errors were encountered:
Thanks @fnordahl indeed I have tested this with a manually patched OVN dns record entry and it works.
We just need to come up with an implementation (or use an external one) for reverse and reverse6 functions.
reverse
reverse6
Sorry, something went wrong.
They are already in https://github.com/canonical/lxd/blob/main/shared/dnsutil/dnsutil.go :)
Excellent, and its my own function from 6 years ago :)
tomponline
No branches or pull requests
The OVN DNS interception supports providing answers for both forward and reverse DNS lookups on instance names.
However, LXD does currently not populate the database with reverse DNS records.
This causes issues for software that rely on correct reverse DNS lookups to determine FQDN.
Something like this could potentially fix it:
The text was updated successfully, but these errors were encountered: