adguard-home/tasks/main.yaml
changeset 204 fd38efd8f637
parent 174 431c6d5e5dd4
child 226 ce33bf94045f
--- a/adguard-home/tasks/main.yaml	Sun Nov 06 23:10:04 2022 -0600
+++ b/adguard-home/tasks/main.yaml	Sun Jan 08 12:57:34 2023 -0600
@@ -56,6 +56,13 @@
     dest: "/etc/resolv.conf"
   when: sym.stat.islnk is defined and sym.stat.islnk
 
+- name: ensure nameserver is self
+  become: yes
+  lineinfile:
+    path: "/etc/resolv.conf"
+    regexp: "^nameserver"
+    line: "nameserver {{ansible_default_ipv4.address}}"
+
 - name: disable systemd-resolved service
   become: yes
   systemd: name="systemd-resolved.service" enabled="no" state="stopped"