Skip to content

Commit

Permalink
can't get ndots right
Browse files Browse the repository at this point in the history
Signed-off-by: Ahmet Alp Balkan <[email protected]>
  • Loading branch information
ahmetb committed Oct 6, 2020
1 parent 35da762 commit 7db84bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion runsd/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (d *dnsHijack) handleLocal(w dns.ResponseWriter, msg *dns.Msg) {
return
}

parts := strings.SplitN(strings.TrimSuffix(q.Name, "."+d.domain), ".", 2)
parts := strings.SplitN(strings.TrimSuffix(q.Name, "."+d.domain+"."), ".", 2)
region := parts[1]
_, ok := cloudRunRegionCodes[region]
if !ok {
Expand Down
4 changes: 2 additions & 2 deletions runsd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
const (
resolvConf = "/etc/resolv.conf"
defaultInternalDomain = "run.internal"
defaultNdots = 3
defaultNdots = 4
defaultDnsPort = "53"
defaultHTTPProxyPort = "80"
)
Expand Down Expand Up @@ -62,7 +62,7 @@ func main() {
defer klog.Flush()
flag.StringVar(&flResolvConf, "resolv_conf_file", resolvConf, "[debug-only] path to resolv.conf(5) file to read/write")
flag.StringVar(&flInternalDomain, "domain", defaultInternalDomain, "internal zone (without a trailing dot)")
flag.IntVar(&flNdots, "ndots", defaultNdots, "ndots setting for resolv conf (e.g. for -domain=a.b this should be 3)")
flag.IntVar(&flNdots, "ndots", defaultNdots, "ndots setting for resolv conf (e.g. for -domain=a.b this should be 4)")
flag.StringVar(&flNameserver, "nameserver", "", "override used nameserver (default: from -resolv_conf_file)")
flag.StringVar(&flRegion, "gcp_region", "", "[debug-only] override GCP region (do not infer from metadata svc)")
flag.BoolVar(&flSkipDNSServer, "skip_dns_hijack", false, "[debug-only] do not start a DNS server for service discovery")
Expand Down

0 comments on commit 7db84bd

Please sign in to comment.