Configure Gate systemd-resolved to serve the wild Ethernet.
authorMatt Birkholz <matt@birchwood-abbey.net>
Fri, 21 Nov 2025 20:39:12 +0000 (13:39 -0700)
committerMatt Birkholz <matt@birchwood-abbey.net>
Fri, 21 Nov 2025 20:39:12 +0000 (13:39 -0700)
README.org
roles_t/gate/handlers/main.yml
roles_t/gate/tasks/main.yml

index bf253a3fdc807f4d3e7f753d8167fa5634250dd1..28f12fcfc2f530a84976d82e77ff4f78295b5309 100644 (file)
@@ -4972,6 +4972,49 @@ UseMTU=true
 UseDNS=false
 #+END_SRC
 
+
+** Configure Gate ResolveD
+
+Gate provides name service on the wild Ethernet by having its "stub
+listener" listen there.  That stub should not read =/etc/hosts= lest
+~gate~ resolve to ~127.0.1.1~, nonsense to the wild.
+
+#+CAPTION: [[file:roles_t/gate/tasks/main.yml][=roles_t/gate/tasks/main.yml=]]
+#+BEGIN_SRC conf :tangle roles_t/gate/tasks/main.yml
+
+- name: Configure resolved.
+  become: yes
+  lineinfile:
+    path: /etc/systemd/resolved.conf
+    regexp: "{{ item.regexp }}"
+    line: "{{ item.line }}"
+  loop:
+  - regexp: '^ *DNSStubListenerExtra *='
+    line: "DNSStubListenerExtra={{ gate_wild_addr }}"
+  - regexp: '^ *ReadEtcHosts *='
+    line: "ReadEtcHosts=no"
+  notify:
+  - Reload Systemd.
+  - Restart Systemd resolved.
+#+END_SRC
+
+#+CAPTION: [[file:roles_t/gate/handlers/main.yml][=roles_t/gate/handlers/main.yml=]]
+#+BEGIN_SRC conf :tangle roles_t/gate/handlers/main.yml
+
+- name: Reload Systemd.
+  become: yes
+  systemd:
+    daemon-reload: yes
+  tags: actualizer
+
+- name: Restart Systemd resolved.
+  become: yes
+  systemd:
+    service: systemd-resolved
+    state: restarted
+  tags: actualizer
+#+END_SRC
+
 ** UFW Rules
 
 Gate uses the Uncomplicated FireWall (UFW) to install its packet
index 6e8eeb84ca02fc5e7307ddb489890a4051d5c883..2ecd80c0a1ade33061976085ca3e1b5870aa67a1 100644 (file)
@@ -4,6 +4,19 @@
   command: networkctl reload
   tags: actualizer
 
+- name: Reload Systemd.
+  become: yes
+  systemd:
+    daemon-reload: yes
+  tags: actualizer
+
+- name: Restart Systemd resolved.
+  become: yes
+  systemd:
+    service: systemd-resolved
+    state: restarted
+  tags: actualizer
+
 - name: Restart WireGuard™.
   become: yes
   systemd:
index ea14e23b4dbf3ee14d63f096742f48050c10e5bb..f35cfed8daa6c1c4a0d8cc493fa78528e829e877 100644 (file)
     force: no
   notify: Reload networkd.
 
+- name: Configure resolved.
+  become: yes
+  lineinfile:
+    path: /etc/systemd/resolved.conf
+    regexp: "{{ item.regexp }}"
+    line: "{{ item.line }}"
+  loop:
+  - regexp: '^ *DNSStubListenerExtra *='
+    line: "DNSStubListenerExtra={{ gate_wild_addr }}"
+  - regexp: '^ *ReadEtcHosts *='
+    line: "ReadEtcHosts=no"
+  notify:
+  - Reload Systemd.
+  - Restart Systemd resolved.
+
 - name: Install UFW.
   become: yes
   apt: pkg=ufw