linuxdeploy icon indicating copy to clipboard operation
linuxdeploy copied to clipboard

cound not resolve host in arch linux

Open Chuanhuan opened this issue 1 year ago • 10 comments

In android 13 tab s8+, after I used

# using google DNS
echo "nameserver 8.8.8.8" > /etc/resolv.conf
echo "127.0.0.1 localhost" > /etc/hosts

# change the group
groupadd -g 3003 aid_inet
groupadd -g 3004 aid_net_raw
groupadd -g 1003 aid_graphics
usermod -g 3003 -G 3003,3004 -a sudo username
usermod -G 3003 -a root

In LD, the SSH server turn on, then I connect with localhost. I can ping google.com in root. However, it's not working in user.

# in user
ping google.com 
google.com: Temporary failure in name resolution

Trying to install yay,

linux% git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -si
Cloning into 'yay'...
fatal: unable to access 'https://aur.archlinux.org/yay.git/': Could not resolve host: aur.archlinux.org

Any possible solution for this? The DNS issue I look up all issue setion and I try some methods but didn't work. The ping google.com when login as user issue, it does not work in debian as well.

Chuanhuan avatar Jan 26 '23 02:01 Chuanhuan

Seems like you don't have permission to access network. Run command groups as your regular non-root user. If missing aid_inet group, you should try add <username>:aid_inet to Bootstrap -> Privileged users option, or add user to the group manually by running sudo usermod -aG aid_inet <username>.

CainSakura avatar Feb 16 '23 03:02 CainSakura

I follow your step then it works! thank you~

nikissXI avatar Feb 21 '23 03:02 nikissXI

I have the same problem when I login with the android user, even though the user has aid_inet.

andrej-ilievski avatar Mar 01 '23 22:03 andrej-ilievski

I have the same problem when I login with the android user, even though the user has aid_inet.

I write down a blog about use linuxdeploy. If you can read Chinese, it may work for you. http://www.nikiss.top/post.php?id=43

nikissXI avatar Mar 02 '23 01:03 nikissXI

Hey @nikissXI thanks for the link, I was hoping to use google translate and read through it but I can't open it. Do you mind checking it if it works?

andrej-ilievski avatar Mar 02 '23 21:03 andrej-ilievski

Hey @nikissXI thanks for the link, I was hoping to use google translate and read through it but I can't open it. Do you mind checking it if it works?

That's weird, can you ping the domain name "www.nikiss.top"? The server is located in China. If you can not ping the domain, you can try add a resolution record "1.13.175.124 www.nikiss.top"

nikissXI avatar Mar 03 '23 01:03 nikissXI

Hi @nikissXI , experiencing the same issue. System is Lineage20 (Android 13), and the rootfs ~~is~~ was a working one without this issue prior to android upgrade from Android 11. What I can confirm is that most network operation from a non-root user is denied, including ping localhost, other address, or using resolv.

magikorb avatar Mar 04 '23 08:03 magikorb

While groupsshows AID_INET on the user who has no internet access.

magikorb avatar Mar 04 '23 08:03 magikorb

change user id and groupid /etc/passwd or useradd new user sudo useradd -m -d /home/test test sudo usermod -a -G aid_inet,aid_net_raw test sudo vi /etc/sudoers add sudo

angrycans avatar Mar 25 '23 13:03 angrycans

If your root user works, and you have configured the right usergroups for your normal user, change your user uid to 4000 or more.

usermod -u 4000 sdykae

usergroups I'm using are from https://github.com/ivon852/netlify-ivon-blog-comments/discussions/454

sdykae avatar Sep 18 '23 07:09 sdykae