mDNS Setup on Arch Linux

This will let other devices on your local network access your machine using a hostname like:

http://archlinux.local:8080

instead of remembering the IP (192.168.x.x).

1. Install required packages

sudo pacman -S avahi nss-mdns


This content originally appeared on DEV Community and was authored by Ashen Chathuranga

This will let other devices on your local network access your machine using a hostname like:

http://archlinux.local:8080

instead of remembering the IP (192.168.x.x).

1. Install required packages

sudo pacman -S avahi nss-mdns

2. Enable and start Avahi

sudo systemctl enable --now avahi-daemon

3. Configure /etc/nsswitch.conf

Open /etc/nsswitch.conf with your favorite editor:

sudo nano /etc/nsswitch.conf

Replace its contents with this (copy and paste):

# Name Service Switch configuration file.
# See nsswitch.conf(5) for details.

passwd: files systemd
group: files [SUCCESS=merge] systemd
shadow: files systemd
gshadow: files systemd

publickey: files

hosts: files mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] dns myhostname
networks: files

protocols: files
services: files
ethers: files
rpc: files

netgroup: files

Save and exit.

4. Restart name resolution

sudo systemctl restart systemd-resolved

5. Test

On your Arch machine, run:

ping archlinux.local

You should see it resolve to your LAN IP (e.g., 192.168.3.224).

On another device (Linux/macOS/iOS), try opening:

http://archlinux.local:8080


This content originally appeared on DEV Community and was authored by Ashen Chathuranga


Print Share Comment Cite Upload Translate Updates
APA

Ashen Chathuranga | Sciencx (2025-08-20T14:06:13+00:00) mDNS Setup on Arch Linux. Retrieved from https://www.scien.cx/2025/08/20/mdns-setup-on-arch-linux/

MLA
" » mDNS Setup on Arch Linux." Ashen Chathuranga | Sciencx - Wednesday August 20, 2025, https://www.scien.cx/2025/08/20/mdns-setup-on-arch-linux/
HARVARD
Ashen Chathuranga | Sciencx Wednesday August 20, 2025 » mDNS Setup on Arch Linux., viewed ,<https://www.scien.cx/2025/08/20/mdns-setup-on-arch-linux/>
VANCOUVER
Ashen Chathuranga | Sciencx - » mDNS Setup on Arch Linux. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/08/20/mdns-setup-on-arch-linux/
CHICAGO
" » mDNS Setup on Arch Linux." Ashen Chathuranga | Sciencx - Accessed . https://www.scien.cx/2025/08/20/mdns-setup-on-arch-linux/
IEEE
" » mDNS Setup on Arch Linux." Ashen Chathuranga | Sciencx [Online]. Available: https://www.scien.cx/2025/08/20/mdns-setup-on-arch-linux/. [Accessed: ]
rf:citation
» mDNS Setup on Arch Linux | Ashen Chathuranga | Sciencx | https://www.scien.cx/2025/08/20/mdns-setup-on-arch-linux/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.