Artix Linux Forum

Artix Linux => Installation / Migration / Configuration => Topic started by: DigitalCyan on 19 January 2022, 16:36:06

Title: How to set up a DNS with connman
Post by: DigitalCyan on 19 January 2022, 16:36:06
Hi frens,

I wanted to set up a custom DNS. I have a feeling that just editing /etc/resolv.conf and write-protecting it would do the trick, but I was wondering if there's a more civil way of doing this?

I'm running runit and connman
Title: Re: How to set up a DNS with connman
Post by: capezotte on 20 January 2022, 01:38:53
If a /var/run/connman directory is present before connman starts, it'll drop its resolv.conf there instead of overwriting the one in /etc.

Since you're under runit, the simplest way to ensure this folder is present is adding this line to /etc/runit/sv/connmand/conf:

Code: [Select]
mkdir -p /var/run/connman

By the way, the ArchWiki actually says this, but in a very systemd-specific way (https://wiki.archlinux.org/title/ConnMan#Avoiding_conflicts_with_local_DNS_server).
Title: Re: How to set up a DNS with connman
Post by: DigitalCyan on 20 January 2022, 14:04:24
If a /var/run/connman directory is present before connman starts, it'll drop its resolv.conf there instead of overwriting the one in /etc.

Since you're under runit, the simplest way to ensure this folder is present is adding this line to /etc/runit/sv/connmand/conf:

Code: [Select]
mkdir -p /var/run/connman

By the way, the ArchWiki actually says this, but in a very systemd-specific way (https://wiki.archlinux.org/title/ConnMan#Avoiding_conflicts_with_local_DNS_server).

sounds reasonable, but will it use the one in /etc?
Title: Re: How to set up a DNS with connman
Post by: strajder on 20 January 2022, 16:10:26
sounds reasonable, but will it use the one in /etc?
https://wiki.archlinux.org/title/Domain_name_resolution#Overwriting_of_/etc/resolv.conf
https://man.archlinux.org/man/resolv.conf.5
Title: Re: How to set up a DNS with connman
Post by: capezotte on 20 January 2022, 16:43:41
sounds reasonable, but will it use the one in /etc?

It always uses, it's hardcoded in the C library.