---
# System prepended metadata

title: mdns discovery on Arch Linux
tags: [Linux]

---

---
tags: Linux
title: mdns discovery on Arch Linux
---

# mdns discovery on Arch Linux

Most application using glibc to resolve domain
if using mdns on lan network like `hotstname.local`
you can install nss-mdns, a plugin for glibc, to resolve domain.

## Install nss-mdns

```bash
$ yay -S avahi nss-mdns
```

## Editor nsswitch.conf

```bash
$ sudo nano /etc/nsswitch.conf
```
Past this line:
```
hosts: files mdns_minimal [NOTFOUND=return] dns myhostname
```
![](https://i.imgur.com/bHlC1td.png)

## Auto start service

```bash
$ systemctl enable avahi-daemon --now
```

## Reference: 
* https://unix.stackexchange.com/questions/43762/how-do-i-get-to-use-local-hostnames-with-arch-linux
* https://github.com/lathiat/nss-mdns