aboutsummaryrefslogtreecommitdiff
path: root/app/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'app/main.go')
-rw-r--r--app/main.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/main.go b/app/main.go
index 012d188..6831c5c 100644
--- a/app/main.go
+++ b/app/main.go
@@ -50,7 +50,10 @@ func main() {
response := MakeMessage(header)
response.AddQuestion([]byte("\x0ccodecrafters\x02io\x00"))
- _, err = udpConn.WriteToUDP(response.bytes(), source)
+ answer := MakeAnswer([]byte("\x0ccodecrafters\x02io\x00"), []byte("\x08\x08\x08\x08"))
+ response.AddAnswer(answer)
+
+ _, err = udpConn.WriteToUDP(response.Bytes(), source)
if err != nil {
fmt.Println("Failed to send response:", err)
}