You are not logged in.
Install Arch Linux in Arch LiveCD, I have done the previous steps, now I am in "arch-chroot", I look /etc/resolv.conf, it is default, then I write "nameserver 8.8.8.8" into "/etc/resolv.conf", now i look /etc/resolv.conf, it was modified by me
# cat /etc/resolv.conf
nameserver 8.8.8.8Then I write "/etc/systemd/network/20-wired.network", and do "systemctl enable systemd-networkd", then I exit arch-chroot and umount /mnt and reboot, when I go to my new system , I find /etc/resolv.conf have be reset to default !!!
> /cat etc/resolv.conf
# Resolver configuration file
# See resolv.conf(5) for detailsand now if I write "nameserver 8.8.8.8" into "/etc/resolv.conf" again, and reboot again, /etc/resolv.conf was all right, it have not be reset
So why? How should I do can set resolv.conf successfully before I reboot to new system?
Last edited by nibazshab (2022-12-15 05:27:17)
Offline
Usually one does not edit “/etc/resolv.conf” manually. This file is being generated by whatever you use to control network. In your case it’s systemd-networkd. (See Scimmia’s comment below)
Last edited by mpan (2022-12-14 17:19:41)
Paperclips in avatars? | Sometimes I seem a bit harsh — don’t get offended too easily!
Offline
networkd doesn't touch resolv.conf.
When you arch-chroot, resolv.conf gets mounted to the one outside the chroot. That's what you're editing when you change it, and why it doesn't persist. If you want to change it, you need to do it from outside the chroot, or unmount first.
Last edited by Scimmia (2022-12-14 15:18:35)
Offline
networkd doesn't touch resolv.conf.
Isn’t systemd-networkd writing “/etc/resolv.conf”?
Paperclips in avatars? | Sometimes I seem a bit harsh — don’t get offended too easily!
Offline
No, it's not. It uses systemd-resolved only.
Offline
oh, thank you Scimmia, that mean i need leave arch-chroot to edit resolv.conf
Offline