mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 18:53:43 -04:00
Resolve TXT records via CNAME (#3557)
* Add test case for TXT lookup via CNAME Signed-off-by: Jonathan Nagy <nagytech@users.noreply.github.com> * Return HostType of explicit TXT records Signed-off-by: Jonathan Nagy <nagytech@users.noreply.github.com> * Adapt TXT method lookup to allow lookup via CNAME Signed-off-by: Jonathan Nagy <nagytech@users.noreply.github.com> * Implement lookup of TXT records via CNAME Signed-off-by: Jonathan Nagy <nagytech@users.noreply.github.com>
This commit is contained in:
committed by
Miek Gieben
parent
acac649c1b
commit
e3266d24f7
@@ -19,8 +19,12 @@ func (s *Service) HostType() (what uint16, normalized net.IP) {
|
||||
ip := net.ParseIP(s.Host)
|
||||
|
||||
switch {
|
||||
|
||||
case ip == nil:
|
||||
return dns.TypeCNAME, nil
|
||||
if len(s.Text) == 0 {
|
||||
return dns.TypeCNAME, nil
|
||||
}
|
||||
return dns.TypeTXT, nil
|
||||
|
||||
case ip.To4() != nil:
|
||||
return dns.TypeA, ip.To4()
|
||||
|
||||
Reference in New Issue
Block a user