9
September
2021
17:17

Resolving the "System error" problem when executing the ping command

9 September 2021 17:17

When running the ping command on Linux, a system error may occur. The reason is not obvious.

The reason lies in the name resolution system.

1. Disabling WINS:

A possible cause of the error is the use of the WINS service when resolving computer names, which is turned on before DNS resolution, and “destroys” the entire chain of determining the IP address by name.

1) using the sudo nano command, fix the file "/etc/nsswitch.conf":

sudo nano /etc/nsswitch.conf

2) completely remove the mention of " from the file " nsswitch.conf "wins".

3) Restart the network service:

sudo service networking restart

or

sudo systemctl restart networking

2. Specifying the correct DNS north

Checking that name resolution is proceeding correctly:

nslookup ya.ru

If an error occurs
nslookup ya.ru

Server: 127.0.0.53

Address: 127.0.0.53#53

server can't find ya.ru: SERVFAIL

This means the problem is in the local DNS service. There are two ways to fix the error:

METHOD 1:
1) launch the terminal and go to the folder

cd /etc/resolvconf/resolv.conf.d

2) edit the file base

nano base

or with one command specifying the full file name:

sudo nano /etc/resolvconf/resolv.conf.d/base

Attention! If you specify the wrong server IP address, the error "Temporary name resolution failure" will appear.
Therefore, it is better to leave the base file empty - see SOLUTION 2.

In file base you can specify or correct a non-standard DNS server:
For example,

nameserver 77.88.8.1

or, for example, the DNS of your provider (109.172.10.70 - DNS Rostelecom).

METHOD 2:

We do the same with the /etc/network/interfaces file if the dns-nameservers parameter is specified in it:

cat  /etc/network/interfaces | grep dns-nameservers

and edit the IP addresses of DNS servers - you can specify several separated by a space. For example:

dns-nameservers 192.168.0.1 77.88.8.1 8.8.8.8

Save changes to file interfaces.

3) after that we restart the “networking” service:

sudo service networking restart

or

sudo systemctl restart networking

Diagnostics of the network service "networking.service"

sudo systemctl status networking
sudo journalctl -xeu networking.service

3. Eliminating the error "Job for networking.service failed because the control process exited with error code."

SOLUTION:

sudo systemctl stop NetworkManager
sudo systemctl disable NetworkManager

4. Elimination of errors "RTNETLINK answers: File exists ifup: failed to bring up" and "The networking.service unit failed" and "systemd[1]: Failed to start Raise network interfaces."

SOLUTION:

sudo ip addr flush dev enp2s0
sudo systemctl restart networking

5. Eliminate the cause of the error “Temporary failure in name resolution” and “ping: ya.ru: Temporary failure in name resolution”

Looking for errors in files /etc/resolvconf/resolv.conf.d/base и /etc/network/interfaces.

File /etc/network/interfaces:

Setting for PC static IP address:

auto lo

iface lo inet loopback

auto enp2s0

allow-hotplug enp2s0

iface enp2s0 inet static

address 192.168.0.70

netmask 255.255.255.0

network 192.168.0.0

broadcast 192.168.0.255

gateway 192.168.0.1

dns-nameservers 192.168.0.1 77.88.8.1 8.8.8.8

dns-search local

Setting for dynamic PC IP address (DHCP):

auto lo

iface lo inet loopback

allow-hotplug enp2s0

auto enp2s0

iface eth0 inet dhcp

File/etc/resolvconf/resolv.conf.d/base: строчку nameserverIt's better to comment out:
# nameserver 192.168.0.1

To apply the changes, run the commands

sudo systemctl restart networking

6. Remove the "Network Manager" applet from startup and taskbar

If you use a static IP address, the "Network Manager" applet is not needed, it takes up free space on the screen.

In LXQT
Start - Settings - LXQt Settings - Session Settings- uncheck against "Network"(/etc/xdg/autostart/nm-applet.desktop), click "Close".

"Start" - "Log out" - "Log out" and log in again.

7. How to check whether the IP address is dynamic or static?

Team:

ip addr

The command output for a dynamic IP address contains the word "dynamic".



Related publications