Skip to content

Commit 2a94f58

Browse files
Handle SRV requests
1 parent 0dae2f9 commit 2a94f58

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

dns.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,17 @@ func createDNSReplyFromRequest(
144144
Hdr: rrHeader(answerName, dns.TypeNIMLOC, config.TTL),
145145
Locator: encodeNetBIOSLocator(config.RelayIPv4.To4()),
146146
})
147+
case dns.TypeSRV:
148+
answer := dns.SRV{Hdr: rrHeader(answerName, dns.TypeSRV, config.TTL), Target: answerName}
149+
reply.Answer = append(reply.Answer, &answer)
150+
151+
if config.RelayIPv4 != nil {
152+
reply.Extra = append(reply.Extra, rr(config.RelayIPv4, answerName, config.TTL))
153+
}
154+
155+
if config.RelayIPv6 != nil {
156+
reply.Extra = append(reply.Extra, rr(config.RelayIPv6, answerName, config.TTL))
157+
}
147158
default:
148159
answers := handleIgnored(logger, q, questionName, queryType(q, request.Opcode), peer, IgnoreReasonQueryTypeUnhandled,
149160
handlerType, rw.RemoteAddr().Network(), delegateQuestion)

0 commit comments

Comments
 (0)