From 256fad4daf1dac747967c46d3591dd8c7681ad15 Mon Sep 17 00:00:00 2001 From: richtr Date: Mon, 8 Sep 2014 14:27:04 +0200 Subject: [PATCH] Suppress recursive mDNS queries and query for PTR records only --- client.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client.go b/client.go index d8e67ea..c4500ed 100644 --- a/client.go +++ b/client.go @@ -167,7 +167,8 @@ func (c *client) query(params *QueryParam) error { // Send the query m := new(dns.Msg) - m.SetQuestion(serviceAddr, dns.TypeANY) + m.SetQuestion(serviceAddr, dns.TypePTR) + m.RecursionDesired = false if err := c.sendQuery(m); err != nil { return nil } @@ -226,7 +227,8 @@ func (c *client) query(params *QueryParam) error { } else { // Fire off a node specific query m := new(dns.Msg) - m.SetQuestion(inp.Name, dns.TypeANY) + m.SetQuestion(inp.Name, dns.TypePTR) + m.RecursionDesired = false if err := c.sendQuery(m); err != nil { log.Printf("[ERR] mdns: Failed to query instance %s: %v", inp.Name, err) }