MoJo2600 / pihole-kubernetes

PiHole on kubernetes
498 stars 173 forks source link

Local DNS configuration #240

Open yellowhat opened 1 year ago

yellowhat commented 1 year ago

Hi, I have installed using the following:

DNS1: 1.1.1.1
DNS2: 1.0.0.1
adminPassword: pihole
dnsmasq:
  customDnsEntries:
    - address=/pihole.lan/192.168.178.200
extraEnvVars:
  DNSMASQ_USER: root
serviceDhcp:
  enabled: false
serviceDns:
  annotations:
    metallb.universe.tf/allow-shared-ip: pihole-svc
  loadBalancerIP: 192.168.178.200
  type: LoadBalancer
serviceWeb:
  annotations:
    metallb.universe.tf/allow-shared-ip: pihole-svc
  loadBalancerIP: 192.168.178.200
  type: LoadBalancer
helm upgrade pihole mojo2600/pihole --install --version 2.9.3 --namespace pihole --create-namespace --values values.yaml --wait

I am able to resolve using dig google.com and I can see the requests in the WebUI. Instead:

$ dig pihole.lan 

; <<>> DiG 9.16.33-RH <<>> pihole.lan
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 37435
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;pihole.lan.            IN  A

;; AUTHORITY SECTION:
.           1641    IN  SOA a.root-servers.net. nstld.verisign-grs.com. 2022101800 1800 900 604800 86400

;; Query time: 0 msec
;; SERVER: 10.0.2.3#53(10.0.2.3)
;; WHEN: Tue Oct 18 08:58:22 

$ dig pihole.lan @192.168.178.200

; <<>> DiG 9.16.33-RH <<>> pihole.lan @192.168.178.200
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20481
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;pihole.lan.            IN  A

;; ANSWER SECTION:
pihole.lan.     0   IN  A   192.168.178.200

;; Query time: 1 msec
;; SERVER: 192.168.178.200#53(192.168.178.200)
;; WHEN: Tue Oct 18 08:58:50 UTC 2022
;; MSG SIZE  rcvd: 55

In the first case I cannot see the query from the WebUI, while I can in the second case.

Am I missing something?

Thanks

dfoulkes commented 9 months ago

hey, if you're using metalb on k3s with a single IP it can become quite templemental assigning the same IP twice. Personally, I found using the work around that works is create a pool with two / three IPs depending if you're using the pihole dhcp feature and assign a unique IP for each.