<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Bezzumnbiu</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Bezzumnbiu"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Bezzumnbiu"/>
	<updated>2026-05-05T19:03:32Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Wayland&amp;diff=31415</id>
		<title>Wayland</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Wayland&amp;diff=31415"/>
		<updated>2025-11-06T09:18:22Z</updated>

		<summary type="html">&lt;p&gt;Bezzumnbiu: Fix mistake&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://en.wikipedia.org/wiki/Wayland%20(protocol) Wayland] is a new display protocol that aims to replace [[Xorg|X11]]. Wayland requires a [[Seat manager|seat manager]] to work.  &lt;br /&gt;
&lt;br /&gt;
The {{ic|setup-wayland-base}} script installs and enables [[elogind]] as [[Seat manager|seat manager]] besides enabling [[Repositories#Community|community repository]] and [[eudev]].&lt;br /&gt;
&lt;br /&gt;
== Compositors ==&lt;br /&gt;
&lt;br /&gt;
Display servers that implement the Wayland display server protocol are also called Wayland compositors because they additionally perform the task of a compositing window manager. &lt;br /&gt;
&lt;br /&gt;
Multiple compositor implementations exist, including [[Sway]], [https://en.wikipedia.org/wiki/Mutter%20(software) Mutter] ([[GNOME]]&#039;s compositor) and [https://en.wikipedia.org/wiki/KWin Kwin] ([[KDE]]&#039;s compositor). The following [[:Category:Compositor|compositors]] are available in Alpine Linux. &lt;br /&gt;
&lt;br /&gt;
== XDG_RUNTIME_DIR ==&lt;br /&gt;
&lt;br /&gt;
As per the protocol spec, Wayland compositors require the &amp;lt;code&amp;gt;XDG_RUNTIME_DIR&amp;lt;/code&amp;gt; variable to be set. &lt;br /&gt;
&lt;br /&gt;
=== With elogind ===&lt;br /&gt;
&lt;br /&gt;
When using [[elogind]] as a seat manager, it exports &amp;lt;code&amp;gt;XDG_RUNTIME_DIR&amp;lt;/code&amp;gt; and other XDG environment variables automatically for each session. No further configuration is required.&lt;br /&gt;
&lt;br /&gt;
=== With pam_rundir === &lt;br /&gt;
&lt;br /&gt;
[https://github.com/jjk-jacky/pam_rundir pam_rundir] is a [[PAM]] module that provides the runtime directory variable. Installing the package {{pkg|pam-rundir}} takes care of dependencies and no further configuration is required.&lt;br /&gt;
&lt;br /&gt;
{{Note| &amp;lt;code&amp;gt;XDG_RUNTIME_DIR&amp;lt;/code&amp;gt; variable MUST be initialised before the Wayland compositor, and also before the D-Bus session instance is started in your startup script/file for both the methods listed below.}}&lt;br /&gt;
&lt;br /&gt;
=== With mkrundir ===&lt;br /&gt;
&lt;br /&gt;
[https://git.sr.ht/~whynothugo/mkrundir mkrundir] is an executable that can be used to initialise the runtime directory explicitly by each user. To use &amp;lt;code&amp;gt;mkrundir&amp;lt;/Code&amp;gt;, install the package {{pkg|mkrundir}} available in [[Repositories#Testing|testing]] repository. In your shell init script (e.g.: {{Path|~/.profile}} include an entry as follows at the &#039;&#039;&#039;top&#039;&#039;&#039; of the file {{Cat|~/.profile|...&lt;br /&gt;
export XDG_RUNTIME_DIR{{=}}$(mkrundir)&lt;br /&gt;
...}}&lt;br /&gt;
&lt;br /&gt;
As per [https://git.sr.ht/~whynothugo/mkrundir mkrundir] website, this might have issues inside containers, due to privilege escalation.&lt;br /&gt;
&lt;br /&gt;
=== Creating and exporting XDG_RUNTIME_DIR manually ===&lt;br /&gt;
&lt;br /&gt;
Generally, care should be taken when configuring the &amp;lt;code&amp;gt;XDG_*&amp;lt;/code&amp;gt; variables manually as this configuration may have errors or conflict with other utilities that do this automatically. Use this only on a system that&#039;s not using [[elogind]] and other solutions outlined above cannot handle this. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;XDG_RUNTIME_DIR&amp;lt;/code&amp;gt; can be initialised manually by adding below snippet to shell init scripts (e.g.: {{Path|~/.profile}}):&lt;br /&gt;
&lt;br /&gt;
{{Cat|~/.profile|&amp;lt;nowiki&amp;gt;if [ -z &amp;quot;$XDG_RUNTIME_DIR&amp;quot; ]; then&lt;br /&gt;
	XDG_RUNTIME_DIR=&amp;quot;/tmp/$(id -u)-runtime-dir&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	mkdir -pm 0700 &amp;quot;$XDG_RUNTIME_DIR&amp;quot;&lt;br /&gt;
	export XDG_RUNTIME_DIR&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== error: XDG_RUNTIME_DIR is invalid or not set in the environment ===&lt;br /&gt;
&lt;br /&gt;
The above error message appears when starting services/applications that require the environment variable [[#XDG_RUNTIME_DIR|XDG_RUNTIME_DIR]] to be set. Fix it using one of the above methods before proceeding. &lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://wiki.archlinux.org/title/Wayland Wayland - Arch Wiki]&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Wayland Wayland - Gentoo Wiki]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Wayland_(protocol) Wayland (protocol) - Wikipedia]&lt;br /&gt;
&lt;br /&gt;
[[Category:Desktop]]&lt;br /&gt;
[[Category:Wayland]]&lt;br /&gt;
[[Category:Compositor]]&lt;/div&gt;</summary>
		<author><name>Bezzumnbiu</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=MDNS&amp;diff=30192</id>
		<title>MDNS</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=MDNS&amp;diff=30192"/>
		<updated>2025-06-04T07:20:42Z</updated>

		<summary type="html">&lt;p&gt;Bezzumnbiu: fix mistakes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:mDNS}}&lt;br /&gt;
[https://en.wikipedia.org/wiki/Multicast_DNS Multicast DNS] is a protocol that is normally used for the discovery of printers.  Avahi is a popular implementation by but more setup is needed for the regular name resolution to see the results.&lt;br /&gt;
&lt;br /&gt;
== Setup avahi ==&lt;br /&gt;
&lt;br /&gt;
Install, enable and start avahi with:{{cmd|$ doas apk add {{pkg|avahi}}&lt;br /&gt;
$ doas rc-update add avahi-daemon&lt;br /&gt;
$ doas rc-service avahi-daemon start}}&lt;br /&gt;
&lt;br /&gt;
It should now be possible to browse results. To look for a printer, use:&lt;br /&gt;
&lt;br /&gt;
{{cmd|$ doas apk add {{pkg|avahi-tools}}&lt;br /&gt;
$ avahi-browse --resolve --terminate  _ipp._tcp}}&lt;br /&gt;
&lt;br /&gt;
Make note of the hostname, as we will use it afterwards.&lt;br /&gt;
&lt;br /&gt;
== Setup avahi2dns ==&lt;br /&gt;
&lt;br /&gt;
Name resolution is implemented by musl, and it only supports DNS, so we have to map the avahi results to a regular DNS server. This is done by [https://github.com/LouisBrunner/avahi2dns avahi2dns]. As of now, {{pkg|avahi2dns}} package is available in the [[Repositories#Testing|testing]] repository. It can be safely installed by following the [[Repositories#Using_testing_repository|guidelines]].&lt;br /&gt;
&lt;br /&gt;
{{cmd|$ doas apk add avahi2dns@testing}}&lt;br /&gt;
&lt;br /&gt;
since we will want a full DNS server running at port 53, we need to configure avahi2dns to use another port. This is done by default with {{path|/etc/conf.d/avahi2dns}} containing:&lt;br /&gt;
&lt;br /&gt;
  command_args=&amp;quot;-p 5354&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Enable and start avahi2dns with the command:{{cmd|$ doas rc-update add avahi2dns&lt;br /&gt;
$ doas rc-service avahi2dns start}}&lt;br /&gt;
&lt;br /&gt;
It should now be possible to use DNS to query the address of the printer:{{cmd|$ drill -p 5354 @127.0.0.1 &amp;lt;printer_name&amp;gt;.local}}&lt;br /&gt;
&lt;br /&gt;
Where printer_name is the hostname given by avahi-browse.&lt;br /&gt;
&lt;br /&gt;
== Setup Networkmanager ==&lt;br /&gt;
&lt;br /&gt;
If you are already using [[NetworkManager|Networkmanager]], you can leverage {{pkg|dnsmasq}} as your DNS server which can easily forward mDNS requests to another server.&lt;br /&gt;
&lt;br /&gt;
Install the {{pkg|networkmanager-dnsmasq}} package: {{cmd|$ doas apk add {{pkg|networkmanager-dnsmasq}}}}&lt;br /&gt;
&lt;br /&gt;
Configure networkmanager to use dnsmasq as it&#039;s dns server by editing {{path|/etc/NetworkManager/NetworkManager.conf}} as follows {{Cat|/etc/NetworkManager/NetworkManager.conf|&amp;lt;nowiki&amp;gt;[main] &lt;br /&gt;
dhcp=internal&lt;br /&gt;
dns=dnsmasq&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Then we need to tell dnsmasq to forward all mDNS queries to avahidns by editing the file {{path|/etc/NetworkManager/dnsmasq.d/mdns.conf}} as follows {{Cat|/etc/NetworkManager/dnsmasq.d/mdns.conf|# Forward queries for the &amp;quot;local&amp;quot; domain to 127.0.0.1 port 5354&lt;br /&gt;
server{{=}}/local/127.0.0.1#5354}}&lt;br /&gt;
&lt;br /&gt;
Restart networkmanager: {{cmd|$ doas rc-service networkmanager restart}}&lt;br /&gt;
&lt;br /&gt;
== Without NetworkManager ==&lt;br /&gt;
&lt;br /&gt;
If you are not using [[NetworkManager|Networkmanager]], you will need to setup a DNS resolver that will forward request of .local domain to avahi2dns and handle other requests normally. There is more than one way to do it.&lt;br /&gt;
&lt;br /&gt;
=== Setup unbound as DNS resolver ===&lt;br /&gt;
&lt;br /&gt;
We will use [[Setting up unbound DNS server|unbound]] as the server and {{ic|resolvconf}} tool to inform unbound about the DHCP results. This option is probably most convenient for a laptop: using the DHCP provided by the server for the regular DNS requests.&lt;br /&gt;
&lt;br /&gt;
Install the programs: {{cmd|$ doas apk add {{pkg|openresolv}} {{pkg|unbound}}}}&lt;br /&gt;
&lt;br /&gt;
Create {{path|/etc/resolvconf.conf}} as follows:{{Cat|/etc/resolvconf.conf|&amp;lt;nowiki&amp;gt;name_servers=127.0.0.1&lt;br /&gt;
unbound_conf=/etc/unbound/unbound.conf.d/resolvconf.conf&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
This tells resolveconf to use a local nameserver and pass the DHCP provided DNS server to unbound. Create {{path|/etc/unbound/unbound.conf.d/avahi-local.conf}} as follows {{Cat|/etc/unbound/unbound.conf.d/avahi-local.conf|&lt;br /&gt;
  forward-zone:&lt;br /&gt;
        name: &amp;quot;local&amp;quot;&lt;br /&gt;
        forward-addr: 127.0.0.1@5354&lt;br /&gt;
  server:&lt;br /&gt;
        do-not-query-localhost: no&lt;br /&gt;
        domain-insecure: &amp;quot;local&amp;quot;&lt;br /&gt;
}}&lt;br /&gt;
This reads the information provided by resolvconf, but forwards .local requests to avahi2dns. We also need to disable dnssec for .local and tell unbound that it is OK to query localhost.&lt;br /&gt;
&lt;br /&gt;
Enable and start unbound. {{cmd|$ doas rc-update add unbound&lt;br /&gt;
$ doas rc-service unbound start}}&lt;br /&gt;
&lt;br /&gt;
=== Using existing bind server as DNS resolver ===&lt;br /&gt;
&lt;br /&gt;
It is assumed that a bind(named) server is already installed and running, if not, then you can use the instructions [[Small-Time_DNS_with_BIND9]]&lt;br /&gt;
&lt;br /&gt;
Once the bind(named) server is up and running, then the solution is to set an access &amp;quot;zone&amp;quot; for postfix addresses.local&lt;br /&gt;
&lt;br /&gt;
To do this, add the following lines to the bind configuration file {{path|/etc/bind/named.conf}} as follows {{Cat|/etc/bind/named.conf|&lt;br /&gt;
&lt;br /&gt;
 zone &amp;quot;local&amp;quot; {&lt;br /&gt;
   type forward; # type requests&lt;br /&gt;
   forward only; # rule to use only forwards&lt;br /&gt;
   forwarders {&lt;br /&gt;
     127.0.0.1 port 5354; # Avahi2dns address and port&lt;br /&gt;
   };&lt;br /&gt;
 };&lt;br /&gt;
}}&lt;br /&gt;
Additionally, you may need to disable dnssec verification for the .local postfix. To do this, add the following lines inside the options configuration {{Cat|/etc/bind/named.conf|...&lt;br /&gt;
&lt;br /&gt;
 options {&lt;br /&gt;
 ...&lt;br /&gt;
   validate-except {&lt;br /&gt;
     &amp;quot;local&amp;quot;;&lt;br /&gt;
   };&lt;br /&gt;
 ...&lt;br /&gt;
 };&lt;br /&gt;
}}&lt;br /&gt;
After adding the configuration, double-check that you have a .local zone. To do this, use the command: {{Cmd|$ named-checkconf -l # OUTPUT: local IN _default forward}}&lt;br /&gt;
&lt;br /&gt;
If there were no errors, you can reload the bind(named) service:{{Cmd|$ doas rc-service named reload}}&lt;br /&gt;
&lt;br /&gt;
=== Setup DHCP client ===&lt;br /&gt;
&lt;br /&gt;
How send the DHCP provided DNS to resolvconf depends on the DHCP client being used.&lt;br /&gt;
&lt;br /&gt;
==== udhcpc ====&lt;br /&gt;
&lt;br /&gt;
This is the DHCP client in busybox, and will work for both wired and wireless interfaces. Create {{path|/etc/udhcpc/udhcpc.conf}} as follows {{path||/etc/udhcpc/udhcpc.conf|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
RESOLV_CONF=&amp;quot;/etc/udhcpc-resolv.conf&amp;quot;&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create the file {{path|/etc/udhcpc/post-bound/resolvconf}} as follows {{Cat|/etc/udhcpc/post-bound/resolvconf|&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
cat /etc/udhcpc-resolv.conf | resolvconf -a $interface&lt;br /&gt;
}}&lt;br /&gt;
and make it executable {{cmd|$ doas chmod 755 /etc/udhcpc/post-bound/resolvconf}}&lt;br /&gt;
&lt;br /&gt;
==== iwd ====&lt;br /&gt;
&lt;br /&gt;
When using [[iwd]] an inconvenience of this setup is that udhcpc will not reconfigure the interface when connecting to other wifi networks. For that to happen one has to run&lt;br /&gt;
&lt;br /&gt;
{{cmd|$ iwctl station wlan0 connect &amp;lt;network_name&amp;gt;&lt;br /&gt;
$ doas kill -USR2 $(cat  /run/udhcpc.wlan0.pid)&lt;br /&gt;
$ doas kill -USR1 $(cat  /run/udhcpc.wlan0.pid)}}&lt;br /&gt;
&lt;br /&gt;
To avoid having to manually reconfigure the wifi interface, we can configure [[iwd]] to use DHCP internally and forward DNS server info to resolveconf. To do that create the file {{path|/etc/iwd/main.conf}} as follows {{Cat|/etc/iwd/main.conf|&amp;lt;nowiki&amp;gt;[General]&lt;br /&gt;
EnableNetworkConfiguration=True&lt;br /&gt;
&lt;br /&gt;
[Network]&lt;br /&gt;
NameResolvingService=resolvconf&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== Test the setup ===&lt;br /&gt;
&lt;br /&gt;
You should be able to query for both the printer address and regular addresses with: {{cmd|$ drill @127.0.0.1 &amp;lt;printer_name&amp;gt;.local&lt;br /&gt;
$ drill @127.0.0.1 alpinelinux.org}}&lt;br /&gt;
&lt;br /&gt;
Your {{path|/etc/resolv.conf}} should also contain {{Cat|/etc/resolv.conf|nameserver 127.0.0.1}}&lt;br /&gt;
&lt;br /&gt;
Printer discovery should now be working.&lt;br /&gt;
&lt;br /&gt;
=== Failure in parallel query of A and AAAA requsts ===&lt;br /&gt;
&lt;br /&gt;
An issue with parallel query of A and AAAA requsts was reported to [https://github.com/LouisBrunner/avahi2dns/issues/21 upstream] related to ipv4/ipv6 dual-setups and since been resolved in Alpine Linux {{MR|82560}} by adding a timeout 2.5s.&lt;br /&gt;
&lt;br /&gt;
[[Category:Networking]]&lt;br /&gt;
[[Category:Printers]]&lt;/div&gt;</summary>
		<author><name>Bezzumnbiu</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=MDNS&amp;diff=29554</id>
		<title>MDNS</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=MDNS&amp;diff=29554"/>
		<updated>2025-04-02T05:29:29Z</updated>

		<summary type="html">&lt;p&gt;Bezzumnbiu: add another config to use bind(named) with mDNS&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:mDNS}}&lt;br /&gt;
[https://en.wikipedia.org/wiki/Multicast_DNS Multicast DNS] is a protocol that is normally used for the discovery of printers.  Avahi is a popular implementation by but more setup is needed for the regular name resolution to see the results.&lt;br /&gt;
&lt;br /&gt;
== Setup avahi ==&lt;br /&gt;
&lt;br /&gt;
Install, enable and start avahi with:&lt;br /&gt;
&lt;br /&gt;
{{cmd|doas apk add {{pkg|avahi}}&lt;br /&gt;
doas rc-update add avahi-daemon&lt;br /&gt;
doas rc-service avahi-daemon start}}&lt;br /&gt;
&lt;br /&gt;
It should now be possible to browse results. To look for a printer, use:&lt;br /&gt;
&lt;br /&gt;
{{cmd|doas apk add {{pkg|avahi-tools}}&lt;br /&gt;
avahi-browse --resolve --terminate  _ipp._tcp}}&lt;br /&gt;
&lt;br /&gt;
Make note of the hostname, as we will use it afterwards.&lt;br /&gt;
&lt;br /&gt;
== Setup avahi2dns ==&lt;br /&gt;
&lt;br /&gt;
Name resolution is implemented by musl, and it only supports DNS, so we have to map the avahi results to a regular DNS server. This is done by avahi2dns.&lt;br /&gt;
&lt;br /&gt;
{{cmd|doas apk add {{pkg|avahi2dns}}}}&lt;br /&gt;
&lt;br /&gt;
since we will want a full DNS server running at port 53, we need to configure avahi2dns to use another port. This is done by default with {{path|/etc/conf.d/avahi2dns}} containing:&lt;br /&gt;
&lt;br /&gt;
  command_args=&amp;quot;-p 5354&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Enable and start avahi2dns with&lt;br /&gt;
&lt;br /&gt;
{{cmd|doas rc-update add avahi2dns&lt;br /&gt;
doas rc-service avahi2dns start}}&lt;br /&gt;
&lt;br /&gt;
It should now be possible to use DNS to query the address of the printer.&lt;br /&gt;
&lt;br /&gt;
{{cmd|drill -p 5354 @127.0.0.1 &amp;lt;printer_name&amp;gt;.local}}&lt;br /&gt;
&lt;br /&gt;
Where printer_name is the hostname given by avahi-browse.&lt;br /&gt;
&lt;br /&gt;
== Setup Networkmanager ==&lt;br /&gt;
&lt;br /&gt;
If you are already using networkmanager, you can leverage {{pkg|dnsmasq}} as your DNS server which can easily forward mDNS requests to another server.&lt;br /&gt;
&lt;br /&gt;
Install the {{pkg|networkmanager-dnsmasq}} package:&lt;br /&gt;
&lt;br /&gt;
{{cmd|doas apk add {{pkg|networkmanager-dnsmasq}}}}&lt;br /&gt;
&lt;br /&gt;
Configure networkmanager to use dnsmasq as it&#039;s dns server by editing {{path|/etc/NetworkManager/NetworkManager.conf}}&lt;br /&gt;
&lt;br /&gt;
  [main] &lt;br /&gt;
  dhcp=internal&lt;br /&gt;
  dns=dnsmasq&lt;br /&gt;
&lt;br /&gt;
Then we need to tell dnsmasq to forward all mDNS queries to avahidns {{path|/etc/NetworkManager/dnsmasq.d/mdns.conf}}:&lt;br /&gt;
&lt;br /&gt;
  # Forward queries for the &amp;quot;local&amp;quot; domain to 127.0.0.1 port 5354&lt;br /&gt;
  server=/local/127.0.0.1#5354&lt;br /&gt;
&lt;br /&gt;
Restart networkmanager:&lt;br /&gt;
&lt;br /&gt;
{{cmd|doas rc-service networkmanager restart}}&lt;br /&gt;
&lt;br /&gt;
== Without NetworkManager ==&lt;br /&gt;
&lt;br /&gt;
=== Setup DNS resolver ===&lt;br /&gt;
&lt;br /&gt;
If you are not using NetworkManager, you will need to setup a DNS resolver that will forward request of .local domain to avahi2dns and handle other requests normally. There is more than one way to do it, but we document an option that is probably most convenient for a laptop: using the DHCP provided server for the regular DNS requests. We will use unbound as the server and resolvconf to inform unbound about the DHCP results.&lt;br /&gt;
&lt;br /&gt;
Install the programs:&lt;br /&gt;
&lt;br /&gt;
{{cmd|doas apk add {{pkg|openresolv}} {{pkg|unbound}}}}&lt;br /&gt;
&lt;br /&gt;
Create {{path|/etc/resolvconf.conf}}:&lt;br /&gt;
&lt;br /&gt;
  name_servers=127.0.0.1&lt;br /&gt;
  unbound_conf=/etc/unbound/unbound.conf.d/resolvconf.conf&lt;br /&gt;
&lt;br /&gt;
This tells resolveconf to use a local nameserver and pass the DHCP provided DNS server to unbound&lt;br /&gt;
&lt;br /&gt;
Create {{path|/etc/unbound/unbound.conf.d/avahi-local.conf}}:&lt;br /&gt;
&lt;br /&gt;
  forward-zone:&lt;br /&gt;
        name: &amp;quot;local&amp;quot;&lt;br /&gt;
        forward-addr: 127.0.0.1@5354&lt;br /&gt;
  server:&lt;br /&gt;
        do-not-query-localhost: no&lt;br /&gt;
        domain-insecure: &amp;quot;local&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This reads the information provided by resolvconf, but forwards .local requests to avahi2dns. We also need to disable dnssec for .local and tell unbound that it is OK to query localhost.&lt;br /&gt;
&lt;br /&gt;
Enable and start unbound&lt;br /&gt;
&lt;br /&gt;
{{cmd|doas rc-update add unbound&lt;br /&gt;
doas rc-service unbound start}}&lt;br /&gt;
&lt;br /&gt;
=== Using bind(named) as DNS resolver ===&lt;br /&gt;
&lt;br /&gt;
It is assumed that bind(named) is already installed and running, if not, then you can use the instructions[[https://wiki.alpinelinux.org/wiki/Small-Time_DNS_with_BIND9]]&lt;br /&gt;
&lt;br /&gt;
If you already have a bind(named) server configured, then the solution is to set an access &amp;quot;zone&amp;quot; for postfix addresses.local&lt;br /&gt;
&lt;br /&gt;
To do this, add the following lines to the bind configuration file (by default, the /etc/bind/named.conf file is used):&lt;br /&gt;
&lt;br /&gt;
 zone &amp;quot;local&amp;quot; {&lt;br /&gt;
   type forward; # type requests&lt;br /&gt;
   forward only; # rule to use only forwards&lt;br /&gt;
   forwarders {&lt;br /&gt;
     127.0.0.1 port 5354; # Avahi2dns adress and port&lt;br /&gt;
   };&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
Additionally, you may need to disable dnssec verification for the .local postfix. To do this, add the following lines inside the options configuration:&lt;br /&gt;
&lt;br /&gt;
 options {&lt;br /&gt;
 ...&lt;br /&gt;
   validate-except {&lt;br /&gt;
     &amp;quot;local&amp;quot;;&lt;br /&gt;
   };&lt;br /&gt;
 ...&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
After adding the configuration, double-check that you have a .local zone. To do this, use the command:&lt;br /&gt;
&lt;br /&gt;
 named-checkconf -l # OUTPUT: local IN _default forward&lt;br /&gt;
&lt;br /&gt;
If there were no errors, you can reload the bind(named) service:&lt;br /&gt;
&lt;br /&gt;
 rc-service named reload&lt;br /&gt;
&lt;br /&gt;
=== Setup DHCP client ===&lt;br /&gt;
&lt;br /&gt;
How send the DHCP provided DNS to resolvconf depends on the DHCP client being used.&lt;br /&gt;
&lt;br /&gt;
==== udhcpc ====&lt;br /&gt;
&lt;br /&gt;
This is the DHCP client in busybox, and will work for both wired and wireless interfaces. &lt;br /&gt;
&lt;br /&gt;
Create {{path|/etc/udhcpc/udhcpc.conf}}:&lt;br /&gt;
&lt;br /&gt;
  RESOLV_CONF=&amp;quot;/etc/udhcpc-resolv.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Create {{path|/etc/udhcpc/post-bound/resolvconf}}:&lt;br /&gt;
&lt;br /&gt;
  #!/bin/sh&lt;br /&gt;
  cat /etc/udhcpc-resolv.conf | resolvconf -a $interface&lt;br /&gt;
&lt;br /&gt;
and make it executable&lt;br /&gt;
&lt;br /&gt;
{{cmd|chmod 755 /etc/udhcpc/post-bound/resolvconf}}&lt;br /&gt;
&lt;br /&gt;
An inconvenience of this setup is that udhcpc will not reconfigure the interface when connecting to other wifi networks. For that to happen one has to run&lt;br /&gt;
&lt;br /&gt;
{{cmd|iwctl station wlan0 connect &amp;lt;network_name&amp;gt;&lt;br /&gt;
doas kill -USR2 $(cat  /run/udhcpc.wlan0.pid)&lt;br /&gt;
doas kill -USR1 $(cat  /run/udhcpc.wlan0.pid)}}&lt;br /&gt;
&lt;br /&gt;
==== iwd ====&lt;br /&gt;
&lt;br /&gt;
To avoid having to manually reconfigure the wifi interface, we can configure iwd to use DHCP internally and forward DNS server info to resolveconf. To do that create {{path|/etc/iwd/main.conf}}:&lt;br /&gt;
&lt;br /&gt;
  [General]&lt;br /&gt;
  EnableNetworkConfiguration=True&lt;br /&gt;
&lt;br /&gt;
  [Network]&lt;br /&gt;
  NameResolvingService=resolvconf&lt;br /&gt;
&lt;br /&gt;
== Test the setup ==&lt;br /&gt;
&lt;br /&gt;
You should now be able to query for both the printer address and regular addresses with&lt;br /&gt;
&lt;br /&gt;
{{cmd|drill @127.0.0.1 &amp;lt;printer_name&amp;gt;.local&lt;br /&gt;
drill @127.0.0.1 alpinelinux.org}}&lt;br /&gt;
&lt;br /&gt;
Your {{path|/etc/resolv.conf}} should also contain&lt;br /&gt;
&lt;br /&gt;
  nameserver 127.0.0.1&lt;br /&gt;
&lt;br /&gt;
Printer discovery should now be working.&lt;br /&gt;
&lt;br /&gt;
[[Category:Networking]]&lt;/div&gt;</summary>
		<author><name>Bezzumnbiu</name></author>
	</entry>
</feed>