Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Name server is gone after chroot [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
rnpf
n00b
n00b


Joined: 05 Aug 2023
Posts: 8

PostPosted: Sat Oct 21, 2023 5:03 pm    Post subject: Name server is gone after chroot [SOLVED] Reply with quote

I am following the installation guide as good as I can and experience the following problem:

When booting from the installation media, I can setup networking (wifi with dhcpd):

Code:
livecd ~ # ping kernel.org
PING kernel.org (139.178.84.217) 56(84) bytes of data.
64 bytes from dfw.source.kernel.org (139.178.84.217): icmp_seq=1 ttl=51 time=181 ms
64 bytes from dfw.source.kernel.org (139.178.84.217): icmp_seq=2 ttl=51 time=203 ms
^C


However, after chrooting:

Code:
livecd ~ # chroot /mnt/gentoo /bin/bash
livecd / # source /etc/profile
export PS1="(chroot) ${PS1}"



I get the following error when trying to emerge iw and wpa_supplicant:

Code:
(chroot) livecd / # emerge --ask net-wireless/iw net-wireless/wpa_supplicant
...
>>> Downloading 'http://distfiles.gentoo.org/distfiles/layout.conf'
--2023-10-21 20:59:48--  http://distfiles.gentoo.org/distfiles/layout.conf
Resolving distfiles.gentoo.org... failed: Temporary failure in name resolution.
wget: unable to resolve host address ‘distfiles.gentoo.org’
!!! Couldn't download '.layout.conf.distfiles.gentoo.org'. Aborting.
...


It seems that this error is due to the name server not working properly:

Code:
(chroot) livecd / # ping kernel.org
ping: kernel.org: Temporary failure in name resolution



The content of /etc/resolv.conf is
Code:
(chroot) livecd / # cat /etc/resolv.conf
# Generated by dhcpcd
# /etc/resolv.conf.head can replace this line
# /etc/resolv.conf.tail can replace this line


I am not sure how to proceed with this situation.


Last edited by rnpf on Sat Oct 21, 2023 6:29 pm; edited 1 time in total
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21635

PostPosted: Sat Oct 21, 2023 5:19 pm    Post subject: Reply with quote

That suggests you skipped the step Copy DNS info. A chroot changes the effective root (hence the name). You are now in a new root where resolv.conf is only set up if you did so personally. You need to return to the old root, copy its resolv.conf into the new root, then resume what you were doing.

Also, as a general tip, please link to documentation you are using, so that we can validate you are reading the right material.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum