From 4c902e62adf27aacde7bd51aa475decfaabfea66 Mon Sep 17 00:00:00 2001
From: JoaoBraveCoding <jmarcal@redhat.com>
Date: Fri, 23 Dec 2022 16:55:58 +0000
Subject: [PATCH] Sets the default sd-dns-resolver for ruler miekgdns

Related to issue: https://github.com/thanos-io/thanos/issues/4204

Problem: in the PR https://github.com/thanos-io/thanos/pull/4519 the
default sd-dns-resolver for querier was set to miekgdns but this change
was never ported to ruler

Solution: this PR brings this default to ruler as well to make it
consistent

Signed-off-by: JoaoBraveCoding <jmarcal@redhat.com>
---
 CHANGELOG.md         | 1 +
 cmd/thanos/config.go | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8e05ad9faf..1c3aab18bb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re
 - [#5880](https://github.com/thanos-io/thanos/pull/5880) Query Frontend: Fixes some edge cases of query sharding analysis.
 - [#5893](https://github.com/thanos-io/thanos/pull/5893) Cache: Fixed redis client not respecting `SetMultiBatchSize` config value.
 - [#5966](https://github.com/thanos-io/thanos/pull/5966) Query: Fixed mint and maxt when selecting series for the `api/v1/series` HTTP endpoint.
+- [#5997](https://github.com/thanos-io/thanos/pull/5997) Rule: switch to miekgdns DNS resolver as the default one.
 
 ### Added
 
diff --git a/cmd/thanos/config.go b/cmd/thanos/config.go
index 48d459cec9..f6280dd1bd 100644
--- a/cmd/thanos/config.go
+++ b/cmd/thanos/config.go
@@ -198,7 +198,7 @@ func (qc *queryConfig) registerFlag(cmd extkingpin.FlagClause) *queryConfig {
 	cmd.Flag("query.http-method", "HTTP method to use when sending queries. Possible options: [GET, POST]").
 		Default("POST").EnumVar(&qc.httpMethod, "GET", "POST")
 	cmd.Flag("query.sd-dns-resolver", "Resolver to use. Possible options: [golang, miekgdns]").
-		Default("golang").Hidden().StringVar(&qc.dnsSDResolver)
+		Default("miekgdns").Hidden().StringVar(&qc.dnsSDResolver)
 	cmd.Flag("query.default-step", "Default range query step to use. This is only used in stateless Ruler and alert state restoration.").
 		Default("1s").DurationVar(&qc.step)
 	return qc