You are not logged in.

#1 2020-03-28 12:12:56

M5Hc6UsQ
Member
Registered: 2018-02-26
Posts: 30

How to resolve .local domain within an Arch Linux chroot

Hi,

I'm using "makechrootpkg" to build custom packages. Some dependencies are hosted in a custom repository in my local network. While normal DNS resolution works it fails to resolve the URL of the custom repository, "http://myrepo.local". Is it possible to resolve this domain within the chroot or do have to use a script to automatically update the host file with the IP address of the repository in the chroot before running "makechrootpkg"?

Offline

#2 2020-03-28 14:53:27

seth
Member
Registered: 2012-09-03
Posts: 50,009

Re: How to resolve .local domain within an Arch Linux chroot

automatically update the host file with the IP address

Do you generally resolve the domain this way?

*.local is typically avahi/mdns so (most likely) nsswitch.conf in the $CHROOT will have to be adapted to utilize this resolver?

Offline

#3 2020-03-28 15:09:57

M5Hc6UsQ
Member
Registered: 2018-02-26
Posts: 30

Re: How to resolve .local domain within an Arch Linux chroot

No I don't, I have the Avahi daemon running. If I add "mdns4_minimal [NOTFOUND=return]" to the nsswitch.conf in the chroot, even the normal name resolution doesn't work anymore.

Offline

#4 2020-03-28 18:04:52

M5Hc6UsQ
Member
Registered: 2018-02-26
Posts: 30

Re: How to resolve .local domain within an Arch Linux chroot

Did some more testing. I created a clean CHROOT with "mkarchroot", installed the "nss-mdns" package and added the "mdns4_minimal" entry to "/etc/nsswitch.conf" in the CHROOT. Now I tried

sudo arch-chroot /my/chroot pacman -Sy

and it works, but when running

sudo arch-nspawn /my/chroot pacman -Sy

I get

Could not resolve host: mynas.local

. The thing is "arch-spawn" is used in the "makechrootpkg" script.

Offline

#5 2020-03-28 21:28:38

seth
Member
Registered: 2012-09-03
Posts: 50,009

Offline

#6 2020-03-28 23:37:32

M5Hc6UsQ
Member
Registered: 2018-02-26
Posts: 30

Re: How to resolve .local domain within an Arch Linux chroot

I assume the CHROOT already uses the host network. The "arch-nspawn" script neither uses "systemd-nspawn@.service" to start the container nor does it add the "--network-veth" / "-n" option.

Last edited by M5Hc6UsQ (2020-03-28 23:39:03)

Offline

#7 2020-03-29 23:17:00

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: How to resolve .local domain within an Arch Linux chroot

If the repo is located on the same machine, not merely the same network, I suggest trying to make the chroot access it via the file:///path/to/repo protocol instead of using an http server and DNS resolution.

makechrootpkg will automatically mount the file:/// repo into the chroot for you.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#8 2020-03-29 23:26:11

M5Hc6UsQ
Member
Registered: 2018-02-26
Posts: 30

Re: How to resolve .local domain within an Arch Linux chroot

The repository is on a different machine.

Offline

Board footer

Powered by FluxBB