Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fallthrough and forward not working together #298

Open
fafarun opened this issue Jul 9, 2024 · 0 comments
Open

fallthrough and forward not working together #298

fafarun opened this issue Jul 9, 2024 · 0 comments

Comments

@fafarun
Copy link

fafarun commented Jul 9, 2024

We used k8s_gateway as principal DNS server for servers.

We need to use fordward to send request to another Dns server for external domain, but my configuration doesn't works.

Config file

.:1053 {
    debug
     k8s_gateway mydomain.com {
        apex ext-rke2-coredns-k8s-gateway.kube-system
        ttl 300
        fallthrough mydomain.com externaldomain.com
     }
     log
     cache 30
     forward externaldomain.com 192.168.11.4
     errors
     health {
        lameduck 5s
     }
     ready
     loop
     reload
     loadbalance
     file /etc/coredns/mydomain.com.db
}
mydomain.com.db: 
----
$ORIGIN mydomain.com.
@       3600  IN  SOA sn.dns.icann.com. no.dns.icann.com. 2015082541  7200  3600  1209600 3600
        3600  IN  A   192.168.0.101 
ns01          IN  A   192.168.0.101

Dig response

; <<>> DiG 9.10.6 <<>> server01.externaldomain.com @192.168.0.101
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 11740
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;server01.externaldomain.com.	IN	A

;; AUTHORITY SECTION:
mydomain.com.		2	IN	SOA	sn.dns.icann.com. no.dns.icann.com. 2015082541 7200 3600 1209600 3600

;; Query time: 4 msec
;; SERVER: 160.31.1.200#53(160.31.1.200)
;; WHEN: Tue Jul 09 09:50:04 CEST 2024
;; MSG SIZE  rcvd: 133

Log of pod :

[DEBUG] plugin/k8s_gateway: Request server01.externaldomain.com. has not matched any zones [mydomain.com.]
[INFO] 10.42.255.138:53702 - 51759 "A IN server01.externaldomain.com. udp 54 false 4096" NXDOMAIN qr,aa,rd 122 0.000440085s

If i remove the fallthrough section, the forward works.

Someone can help me to understand where i make a mistake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant