LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-03-2023, 11:19 PM   #1
Cranegsh
Member
 
Registered: Jan 2023
Posts: 40

Rep: Reputation: 0
How to address the issue: failed to start Network Name Resolution


Hello,

I am setting up the wifi for a customized Linux image. It uses systemd to manage network.

Right now, I am able to config the ip address and ping 8.8.8.8, but get "bad address" when ping google.ca.

It is because that the systemd-resolved service failed to start.

systemctl status shows below info:
Active: failed (Result: exit-code)
Process: 254 ExecStart=/lib/systemd/systemd-resolved (code=exited, status=226/NAMESPACE).
Main PID: 255 (code=exited, status=226/NAMESPACE)

journalctl shows below info:
systemd-resolved.service: Failed to set up mount namespacing: /run/systemd/unit-root/dev: No such file or directory
systemd-resolved.service: Failed at step NAMESPACE spawning /lib/systemd/systemd-resolved: No such file or directory

I guess the issue is that the files required for systemd-resolved to execute successfully are not there.

But by googling I couldn't find how to set up there two files and how systemd-resolved sets up the name server.

Has tried to configure the name server in /etc/systemd/resolved.conf, /etc/systemd/resolved.conf.d/dns.conf and /run/systemd/resolve/resolv.conf. None of them works.

Any help is appreciated. Thanks!

Regards,
Crane
 
Old 09-04-2023, 01:33 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,041

Rep: Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348
probably you can find here something useful. Otherwise would be nice to know a bit more about your system
 
Old 09-04-2023, 10:47 AM   #3
Cranegsh
Member
 
Registered: Jan 2023
Posts: 40

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pan64 View Post
probably you can find here something useful. Otherwise would be nice to know a bit more about your system
Thanks Pan64 for your reply.

It is a Linux 5.15.34-v7 running on Raspberry Pi 3B. Systemd is used to manage network services.
 
Old 09-06-2023, 08:27 PM   #4
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,857

Rep: Reputation: 161Reputation: 161
What is your Linux distribution?
 
Old 09-06-2023, 09:12 PM   #5
Cranegsh
Member
 
Registered: Jan 2023
Posts: 40

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by nini09 View Post
What is your Linux distribution?
I am customizing the distribution using meta-raspberrypi Kirkstone.
 
Old 09-07-2023, 08:21 PM   #6
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,857

Rep: Reputation: 161Reputation: 161
Are there any error message in dmesg output?
 
Old 09-07-2023, 08:31 PM   #7
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,384
Blog Entries: 28

Rep: Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164
Perhaps this article from the Arch Wiki will help.

Here's a bit that looks relevant:

Quote:
Setting DNS servers
Tip: To check the DNS currently in use by systemd-resolved, run resolvectl status.
Automatically

systemd-resolved will work out of the box with a network manager using /etc/resolv.conf. No particular configuration is required since systemd-resolved will be detected by following the /etc/resolv.conf symlink. This is going to be the case with systemd-networkd, NetworkManager, and iwd.

However, if the DHCP and VPN clients use the resolvconf program to set name servers and search domains (see openresolv#Users for a list of software that use resolvconf), the additional package systemd-resolvconf is needed to provide the /usr/bin/resolvconf symlink.
 
Old 09-07-2023, 11:10 PM   #8
Cranegsh
Member
 
Registered: Jan 2023
Posts: 40

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by nini09 View Post
Are there any error message in dmesg output?
dmesg shows below failure:
Failed to start Remount Root and Kernel File Systems. ->occurs once and obviously the RootFS is mounted.
Failed to start Network Name Resolution. -> multiple times
Failed to start Network Time Synchronization. -> multiple times

use systemctl to check their statues.
systemd-resolved status is failed.
systemd-timesyncd status is failed.
 
Old 09-07-2023, 11:13 PM   #9
Cranegsh
Member
 
Registered: Jan 2023
Posts: 40

Original Poster
Rep: Reputation: 0
Wanted to try something. But, have no idea why the file /etc/systemd/network/20-wireless-dynamic.network and /etc/wpa_supplicant/wpa_supplicant-wlan0.conf are gone.
Add the files back, and even the IP address for wlan0 is not set any more.

Investigating now...
 
Old 09-09-2023, 12:35 AM   #10
Cranegsh
Member
 
Registered: Jan 2023
Posts: 40

Original Poster
Rep: Reputation: 0
Find the typo when adding /etc/wpa_supplicant/wpa_supplicant-wlan0.conf. Fixed and get the wlan0 ip set again. Continue to address the name resolution issue.

Quote:
Originally Posted by frankbell View Post
Perhaps this article from the Arch Wiki will help.

To check the DNS currently in use by systemd-resolved, run resolvectl status.
Run resolvectl status and it shows below info:
FAiled to get global data. Failed to activate service 'org.freedesktop.resolve1': timed out (service_start_timeout=25000ms)

Quote:
Automatically systemd-resolved will work out of the box with a network manager using /etc/resolv.conf. No particular configuration is required since systemd-resolved will be detected by following the /etc/resolv.conf symlink. This is going to be the case with systemd-networkd, NetworkManager, and iwd.
/etc/resolv.conf is a link file. It eventually links to /run/systemd/resolve/resolv.conf. Tried to add name server configuration in that file and it didn't work.

Quote:
However, if the DHCP and VPN clients use the resolvconf program to set name servers and search domains (see openresolv#Users for a list of software that use resolvconf), the additional package systemd-resolvconf is needed to provide the /usr/bin/resolvconf symlink.
Wondering how to add /usr/bin/resolvconf symlink and if it make sense to add a symlink in a bin folder.
 
Old 09-09-2023, 03:32 PM   #11
Cranegsh
Member
 
Registered: Jan 2023
Posts: 40

Original Poster
Rep: Reputation: 0
How to address the issue: failed to start Network Name Resolution?

Tried to add below to configure DNS and separate lines and change port number. None of them work.
1) DNS=8.8.8.8 8.8.4.4
2) DNS=8.8.8.8:9953%wlan0 8.8.4.4:9953%wlan0
Not sure if it is really accurate. But haven't find any reference.

Basically there are two places to configure DNS server:
1) /etc/systemd/resolved.conf
2) /etc/systemd/resolved.conf.d/dns.conf
Also tried to add directly in /etc/systemd/network/20-wireless-dynamic.network.
And tried to add fallbackDNS in /etc/systemd/resolved.conf.
None of them work.
And the status of systemd-resolved is always "code-exited, status=226/NAMESPACE". Didn't find anything relevant to this error.
And the "resolvectl status" shows the error: Failed to activate service 'org.freedesktop.resolve1": timeout out.

Referred to these links:
https://gbe0.com/posts/linux/systemd-resolved-setup/
https://wiki.archlinux.org/title/systemd-resolved
and manuals for systemd-resolved.service, resolved.conf and org.freedesktop.resolve1. Some information is beyond my knowledge and didn't look deeply.
I don't think it should be this hard. Must be something missing.
Any input about ways to try or debug will be appreciated.
 
Old 09-10-2023, 02:25 AM   #12
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,041

Rep: Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348
Quote:
Failed to start Remount Root and Kernel File Systems. ->occurs once and obviously the RootFS is mounted.
This looks important, but not directly related to name resolution. I think it may cause the missing /run/systemd/unit-root/dev
 
Old 09-11-2023, 01:18 PM   #13
Cranegsh
Member
 
Registered: Jan 2023
Posts: 40

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pan64 View Post
This looks important, but not directly related to name resolution. I think it may cause the missing /run/systemd/unit-root/dev
Thanks! It could be. Will work on that failure first to see.
 
Old 09-11-2023, 11:13 PM   #14
Cranegsh
Member
 
Registered: Jan 2023
Posts: 40

Original Poster
Rep: Reputation: 0
systemd-remount-fs failed with these information.

root@farview-rpi3:~# systemctl status systemd-remount-fs -l
x systemd-remount-fs.service - Remount Root and Kernel File Systems
Loaded: loaded (/lib/systemd/system/systemd-remount-fs.service; enabled-runtime; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2022-04-28 17:42:28 UTC; 25min ago
Docs: man:systemd-remount-fs.service(8)
https://www.freedesktop.org/wiki/Sof...APIFileSystems
Process: 130 ExecStart=/lib/systemd/systemd-remount-fs (code=exited, status=1/FAILURE)
Main PID: 130 (code=exited, status=1/FAILURE)

Apr 28 17:42:28 farview-rpi3 systemd[1]: Starting Remount Root and Kernel File Systems...
Apr 28 17:42:28 farview-rpi3 systemd-remount-fs[133]: mount: /dev/pts: mount point not mounted or bad option.
Apr 28 17:42:28 farview-rpi3 systemd-remount-fs[130]: /bin/mount for /dev/pts exited with exit status 32.
Apr 28 17:42:28 farview-rpi3 systemd[1]: systemd-remount-fs.service: Main process exited, code=exited, status=1/FAILURE
Apr 28 17:42:28 farview-rpi3 systemd[1]: systemd-remount-fs.service: Failed with result 'exit-code'.
Apr 28 17:42:28 farview-rpi3 systemd[1]: Failed to start Remount Root and Kernel File Systems.
root@farview-rpi3:~#

Are they possibly caused by anything missing in kernel config?
 
Old 09-12-2023, 01:07 AM   #15
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,041

Rep: Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348
so you have problems with /dev/pts. You need to look for related error messages, probably try dmesg or journalctl.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Unable to Ping Hosts by Domain Name - Temporary failure in name resolution LearningSponge Linux - Networking 8 03-01-2023 11:38 AM
"Name resolution failure"-- but already using IP address, there is no name to resolve firejuggler86 Linux - Networking 1 05-14-2017 02:12 AM
Name to IP resolution works but not IP to name brandon@rhiamet.com Linux - Server 3 02-18-2009 04:45 PM
Telnet : Temporary failure in name resolution : Host name lookup failure koodoo Linux - Newbie 10 02-11-2008 07:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration