Add UDP forwarding from Nginx

This is working locally, I can resolve addresses. But there still
seems to be another problem in that Windows is timing out when setting
the Pi as the DNS server.
This commit is contained in:
Thomas Kleinendorst 2024-04-15 10:20:02 +02:00
parent 690b2d56d8
commit f23093d8dc
2 changed files with 25 additions and 0 deletions

View file

@ -0,0 +1,7 @@
stream {
server {
listen 53 udp;
proxy_pass 127.0.0.1:5053;
proxy_responses 0;
}
}

View file

@ -74,6 +74,24 @@
- name: Debug
ansible.builtin.debug:
msg: "Don't forget to manually add a DNS record for pi-hole.kleinendorst.info pointing to: {{ ansible_facts['default_ipv4']['address'] }}."
- name: Setup udp port forwarding (53 > 5053) in nginx
become: true
ansible.builtin.blockinfile:
path: /etc/nginx/nginx.conf
insertbefore: '^http \{$'
block: |
stream {
server {
listen 53;
proxy_pass 127.0.0.1:5053;
}
server {
listen 53 udp;
proxy_pass 127.0.0.1:5053;
}
}
notify: Restart Nginx
# - name: Add forwarding rules for ufw
# become: true
# ansible.builtin.blockinfile: