Ping system error linux

Сайт про радиолюбительское хобби и операционную систему Linux.

При выполнении команды ping в Linux может возникнуть системная ошибка. Причина её неочевидная.

Причина кроется в системе разрешения имён.

1. Отключение WINS:

Возможная причина ошибки — в использовании службы WINS при разрешении имён компьютеров, которое включается перед разрешением DNS, и «рушит» всю цепочку определения IP адреса по имени.

1) с использованием команды sudo nano исправить файл «/etc/nsswitch.conf»:

sudo nano /etc/nsswitch.conf

2) полностью удалить из файла «nsswitch.conf» упоминание «wins«.

3) Перезапустить службу сети:

sudo service networking restart

или

sudo systemctl restart networking

2. Указание правильного DNS севера

Проверка, что разрешение имён проходи корректно:

nslookup ya.ru

Если возникла ошибка
nslookup ya.ru
Server: 127.0.0.53
Address: 127.0.0.53#53

server can’t find ya.ru: SERVFAIL

значит проблема в локальной службе DNS. Исправить ошибку можно двумя способами:

СПОСОБ 1:
1) запускаем терминал и переходим в папку

cd /etc/resolvconf/resolv.conf.d

2) редактируем файл base

nano base

или одной командой с указанием полного имени файла:

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

Внимание! Если указать неправильный IP адрес сервера, возникнет ошибка «Временный сбой в разрешении имен»
Поэтому лучше файл base оставить пустым — см. РЕШЕНИЕ 2.

В файле base можно указать или исправить нестандартный DNS сервер:
Например,

nameserver 77.88.8.1

или, например, DNS своего провайдера (109.172.10.70 — DNS Ростелеком).

СПОСОБ 2:

То же самое проделываем с файлом /etc/network/interfaces, если в нём указан параметр dns-nameservers:

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

и редактируем ip-адреса серверов DNS — можно указать несколько через пробел. Например:

dns-nameservers 192.168.0.1 77.88.8.1 8.8.8.8

Сохраняем изменения в файл interfaces.

3) после этого перезапускаем службу «networking»:

sudo service networking restart

или

sudo systemctl restart networking

Диагностика сетевой службы «networking.service»

sudo systemctl status networking
sudo journalctl -xeu networking.service

3. Устранение ошибки «Job for networking.service failed because the control process exited with error code.»

РЕШЕНИЕ:

sudo systemctl stop NetworkManager
sudo systemctl disable NetworkManager

4. Устранение ошибок «RTNETLINK answers: File exists ifup: failed to bring up» и «Произошел сбой юнита networking.service» и «systemd[1]: Failed to start Raise network interfaces.»

РЕШЕНИЕ:

sudo ip addr flush dev enp2s0
sudo systemctl restart networking

5. Устраняем причину ошибки «Временный сбой в разрешении имен» и «ping: ya.ru: Временный сбой в разрешении имен»

Ищем ошибки в файлах /etc/resolvconf/resolv.conf.d/base и /etc/network/interfaces.

Файл /etc/network/interfaces:

Настройка для статического IP адреса ПК:

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

Настройка для динамического ip-адреса ПК (DHCP):

auto lo
iface lo inet loopback
allow-hotplug enp2s0
auto enp2s0
iface eth0 inet dhcp

Файл /etc/resolvconf/resolv.conf.d/base: строчку nameserver лучше закомментировать:
# nameserver 192.168.0.1

Для применения изменений выполнить команды

sudo systemctl restart networking

6. Убираем апплет «Network Manager» из автозагрузки и панели задач

Если используется статический IP-адрес, апплет «Network Manager» не нужен, он занимает свободное место не экране.

В LXQT
Пуск — Настройки — Настройки LXQt — Настройки сеанса — снять галочку против «Сеть» (/etc/xdg/autostart/nm-applet.desktop), нажать «Закрыть»».

«Пуск» — «Выйти» — «Выйти из системы» и войти снова.

7. Как проверить, динамический или статический IP адрес?

Команда:

ip addr

Вывод команды для динамического IP адреса содержит слово «dynamic».

Похожие публикации

>>>>nslookup ссылается на действующий dns сервер и имя резолвит.
>>> Что выводит?
>>> Вам IPv6 актуально? Если нет — отключите ipv6.
>>> https://www.google.com/search?newwindow=1&q=ubuntu+18.04+pin.
>> IPv6 отключил. Ничего не поменялось.
> cat /etc/nsswitch.conf

Блинн, огромное спасибо! Я и забыл, что правил его. Поменял, как было и всё зашуршало!

Источник

Arch Linux

You are not logged in.

#1 2016-10-28 15:21:50

[Solved] Firefox works, but ping, pacman, curl doesn’t work.

I’m experiencing a very strange issue. It is happening since today morning.

When I try upgrading the system, I receive the below errors:

When I try ping, this happens:

Similar problems also come up with curl, wget etc.

However, ping with direct ip address works.

So, the problem must be somewhere in DNS system but I can’t find where.

I also tried strace but I’m not able to make sense of it.

While running all of the above commands which do not work, journald logs no errors.

The strange thing is that Firefox is working without any problems. It resolves domain names without any problems. I’m writing this post on the same system using firefox. Chromium is working. Steam is also working and updating Dota2 as I’m writing this. However, Thunderbird fails to connect to any email servers.

I have tried below to pinpoint the issue but it doesn’t change anything:
— downgrading dnsmasq doesn’t change anything.
— downgrading curl, wget etc doesn’t change anything.
— switching kernel to lts (I have both regular and lts kernel installed always. ) also doesn’t change anything.

I’m at my wit’s end. Don’t know what else to do? Kindly help.

Last edited by Dark.Light (2016-10-29 04:03:55)

#2 2016-10-28 15:32:08

Re: [Solved] Firefox works, but ping, pacman, curl doesn’t work.

Currently experiencing the same issues immediately after upgrading.

`curl` etc. tries to connect using ipv6, but I don’t have a network interface with an ipv6 address. Chromium works fine.

This is the upgrade that supposedly broke everything, which is weird, because none of the packages seem relevant.

Last edited by mk (2016-10-28 15:39:02)

#3 2016-10-28 15:53:08

Re: [Solved] Firefox works, but ping, pacman, curl doesn’t work.

Aha — found the issue. It’s smbclient that’s broken.

Either downgrade smbclient or remove “wins” from /etc/nsswitch.conf.

Last edited by mk (2016-10-28 15:53:44)

Источник

Ping system error linux

При выполнении команды ping в Linux может возникнуть системная ошибка. Причина её неочевидная.

Причина кроется в системе разрешения имён.

1. Отключение WINS:

Возможная причина ошибки — в использовании службы WINS при разрешении имён компьютеров, которое включается перед разрешением DNS, и «рушит» всю цепочку определения IP адреса по имени.

1) с использованием команды sudo nano исправить файл «/etc/nsswitch.conf»:

2) полностью удалить из файла «nsswitch.conf» упоминание «wins«.

3) Перезапустить службу сети:

2. Указание правильного DNS севера

Проверка, что разрешение имён проходи корректно:

Если возникла ошибка
nslookup ya.ru
Server: 127.0.0.53
Address: 127.0.0.53#53

server can’t find ya.ru: SERVFAIL

значит проблема в локальной службе DNS. Исправить ошибку можно двумя способами:

СПОСОБ 1:
1) запускаем терминал и переходим в папку

2) редактируем файл base

или одной командой с указанием полного имени файла:

Внимание! Если указать неправильный IP адрес сервера, возникнет ошибка «Временный сбой в разрешении имен»
Поэтому лучше файл base оставить пустым — см. РЕШЕНИЕ 2.

В файле base можно указать или исправить нестандартный DNS сервер:
Например,

или, например, DNS своего провайдера (109.172.10.70 — DNS Ростелеком).

СПОСОБ 2:

То же самое проделываем с файлом /etc/network/interfaces, если в нём указан параметр dns-nameservers:

и редактируем ip-адреса серверов DNS — можно указать несколько через пробел. Например:

dns-nameservers 192.168.0.1 77.88.8.1 8.8.8.8

Сохраняем изменения в файл interfaces .

3) после этого перезапускаем службу «networking»:

Диагностика сетевой службы «networking.service»

3. Устранение ошибки «Job for networking.service failed because the control process exited with error code.»

4. Устранение ошибок «RTNETLINK answers: File exists ifup: failed to bring up» и «Произошел сбой юнита networking.service» и «systemd[1]: Failed to start Raise network interfaces.»

5. Устраняем причину ошибки «Временный сбой в разрешении имен» и «ping: ya.ru: Временный сбой в разрешении имен»

Ищем ошибки в файлах /etc/resolvconf/resolv.conf.d/base и /etc/network/interfaces .

Файл /etc/network/interfaces:

Настройка для статического IP адреса ПК:

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

Настройка для динамического ip-адреса ПК (DHCP):

auto lo
iface lo inet loopback
allow-hotplug enp2s0
auto enp2s0
iface eth0 inet dhcp

Файл /etc/resolvconf/resolv.conf.d/base : строчку nameserver лучше закомментировать:
# nameserver 192.168.0.1

Для применения изменений выполнить команды

6. Убираем апплет «Network Manager» из автозагрузки и панели задач

Если используется статический IP-адрес, апплет «Network Manager» не нужен, он занимает свободное место не экране.

В LXQT
Пуск — Настройки — Настройки LXQt — Настройки сеанса — снять галочку против «Сеть» (/etc/xdg/autostart/nm-applet.desktop), нажать «Закрыть»».

«Пуск» — «Выйти» — «Выйти из системы» и войти снова.

7. Как проверить, динамический или статический IP адрес?

Вывод команды для динамического IP адреса содержит слово «dynamic».

Источник

Debian User Forums

ping reports «system error»

ping reports «system error»

#1 Post by hbauer » 2019-01-26 16:48

today I installed a Debian system with debootstrap. (this page is in german but I am sure you get the steps https://www.hagen-bauer.de/2019/01/alix . retch.html) The system is running and allows me to login and install software. So in general it looks successful. Unfortunately there is something wrong with DNS.

I can ping other hosts using the ip address but if I try to ping them via fqdn it get an «system error»

Any hint where I could start?

Re: ping reports «system error»

#2 Post by Head_on_a_Stick » 2019-01-26 18:15

Enter the error message into your favorite search engine and follow the bread crumbs.

If you still can’t figure it out, post back listing everything you have tried in as much detail as possible so we don’t waste your time suggesting things you have already attempted.

Re: ping reports «system error»

#3 Post by hbauer » 2019-01-26 20:20

Thats what I already did but with https://www.google.com/search?client=fi . %22+debian I could not find any hint that would match my situation.

I have a plain vanilla Debian system and no Redhat, Windows SMB or NFS problems.

Re: ping reports «system error»

#4 Post by Head_on_a_Stick » 2019-01-26 21:26

Re: ping reports «system error»

#5 Post by hbauer » 2019-01-27 04:34

Re: ping reports «system error»

#6 Post by p.H » 2019-01-27 11:24

What’s «myhostname» doing in the hosts: line ?

Edit : I first thought that it was a placeholder for the actual local host name, but there is really a NSS resolver library with this name.
Is the package libnss-myhostname installed ?
Did you try and move or remove each component in the line in turns and check what happens ?

When I have no clue, I run the command with strace to print system calls.

Re: ping reports «system error»

#7 Post by hbauer » 2019-01-27 13:55

This is the same entry that is working on other boxes I am running so it should be good.

This is the first time I am working with strace and I might overlook important elements. But when I compare the output of strace on a working machine with my problematic box I see this

Why should this ping process not be able to access this files?

Источник

ping displays «Name or service not known»

I am running Arch Linux on a Raspberry Pi.

  1. I am unable to ping to a website.
  2. I am unable to access a website from the browser.

I have two more computers (all running Arch Linux) connected to the Internet, where I can ping and use the Internet. Also, /etc/resolv.conf is identical on the other computers:

I can use VNC. I can also ping to 8.8.8.8. When trying to access DuckDuckGo on Chromium I get:

I have an active Internet connection. What’s wrong?

5 Answers 5

Although I’ve never had problem with my other x86_64 PC all running Arch Linux, this frequently happens till date with Arch Linux ARM when running NetworkManager.

The problem is like you are connected to wifi, but you can’t ping or use the internet but you can access all the computers on the local network, and even use remote desktop sharing software.

There is a high chance that something went wrong while your ping or your browser tries to resolve the host. I can think of 3 solutions:

Solution 1

I believe this is a problem on the thousands of the Raspberry Pi systems running Archlinux ARM and using NetworkManger.

In my case /etc/resolv.conf was a broken symlink to ../run/systemd/resolve/stub-resolv.conf .

NetworkManager can’t populate the symlink, and the /etc/resolv.conf is empty. We have to:

  1. Remove the broken symlink:
  1. Create an /etc/NetworkManager/conf.d/dns.conf file with the contents:
  1. Restart NetworkManager:

This should fix the issue, if not follow Solution 2.

Solution 2

In case the above didn’t fix the issue for you, you can temporarily populate /etc/resolv.conf by:

The reason this works is because probably something is messing up the /etc/resolv.conf file. The above command should overwrite the contents, but again, you should look at what causing the issue.

Solution 3

If you can’t get your /etc/resolv.conf back, just create a new /etc/resolv.conf (delete if an empty old one or symbolic link exists) and paste the code:

Note, in the first line, you can also use your router’s IP address, for example ( nameserver 192.168.43.1 in my case) which will make other systems pingable on the same network. It’s not a good idea to generate resolv like this, but I had a bad time with the NetworkManager’s auto-generated resolv. Systemd-resolvd also generates wrong ones, even on my PC.

A bit weird, here I am using google’s primary dns and cloudflare’s primary dns, you can use 8.8.8.8 with 8.8.4.4 or 1.1.1.1 with 1.0.0.1.

Although that step works, but you may want to stop NetworkManager from overwriting the file whenever it restarts:

Add this entry to /etc/NetworkManager/NetworkManager.conf

They worked for my installations on Raspberry Pi 3 model B. Hope this will work for you, too.

I’ve just had problem with same effects. Check if time is set properly. DNSSEC seems to be enabled by default and blocking requests due to «expired» certificates.

Some other problems related to this can be diagnosed with journalctl -u systemd-resolved -b -0 .

I had this issue on Raspberry Pi 4 running Arch Linux.

The symptoms were that there was no DNS, producing the ping error message.

I observed by calling date that the time was severely off, about two days in the past.

I made sure that time synchronisation was on with systemctl status systemd-timesyncd but noticed from the output of timedatectl timesync-status that the service didn’t have an IP address for the NTP server (it said Server: Null ).

Using jaku255’s tip of checking journalctl -u systemd-resolved -b -0 , I saw that time synchronisation didn’t work because DNS was failing:

DNSSEC validation failed for question ntp.org IN DS: signature-expired

It’s a bit of a deadlock: DNS doesn’t work because the time is wrong and the time is wrong because DNS doesn’t work.

Attempting to set the time manually, I issued

but this produced an error:

Failed to set time: Automatic time synchronization is enabled

To fix this, I temporarily (hehe^^) disabled time synchronization with

and called timedatectl set-time again, this time successfully.

Afterwards, I reactivated time synchronization with timedatectl set-ntp 1 and made sure using timedatectl timesync-status that synchronisation works now:

Also, ping and curl work fine now with DNS succeeding.

Wanted to add one more to Goswami’s solution list.

I face the same problem of chicken-and-egg between DNSSEC and NTP on my tiny portable servers running Debian 10. Sometimes they stay unpowered for quite some time and literally lose sense of time, while world changes around them, so I could not just create a static hot-fix configuration(s). At the same time, they do have to get online on their own when powered, as I do not have physical access to them. I decided to break out of the loop through correcting time first and so far this method seem to be reliable enough.

Solution 4

Obtain list of reliable IP addresses of reliable and trustworthy NTP servers. Let’s use this one, for instance: https://tf.nist.gov/tf-cgi/servers.cgi . Here are some samples from there:

Since I use chronyd for time sync, I simply added those IP addresses to its config: (NOTE: that also works for ntpd config, usually found at /etc/ntp.conf )

Now, chrony goes through all specified addresses until it is able to connect and obtain time. And from that point everything else starts working properly.

I have a script on my mainframe that periodically checks that all IPs on the list are active and notifies if any of them go offline, so I can update remote configs when necessary, while servers are online and not all NTP servers expired.

Probably, the best practice would be to have fall-back configs for both ends, DNS and NTP.

Источник

Adblock
detector

hbauer

Posts: 30
Joined: 2015-10-26 15:38

ping reports «system error»

#1

Post

by hbauer » 2019-01-26 16:48

Hi to all

today I installed a Debian system with debootstrap. (this page is in german but I am sure you get the steps https://www.hagen-bauer.de/2019/01/alix … retch.html) The system is running and allows me to login and install software. So in general it looks successful. Unfortunately there is something wrong with DNS.

I can ping other hosts using the ip address but if I try to ping them via fqdn it get an «system error»

Any hint where I could start?

Code: Select all

nslookup host.domain.lcl
Server:		192.168.2.1
Address:	192.168.2.1#53

Name:	host.domain.lcl
Address: 192.168.2.16

root@host:~# ping 192.168.2.16
PING 192.168.2.16 (192.168.2.16) 56(84) bytes of data.
64 bytes from 192.168.2.16: icmp_seq=1 ttl=64 time=0.089 ms
64 bytes from 192.168.2.16: icmp_seq=2 ttl=64 time=0.081 ms
^C
--- 192.168.2.16 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1005ms
rtt min/avg/max/mdev = 0.081/0.085/0.089/0.004 ms
root@host:~# ping host.domain.lcl
ping: host.domain.lcl: System error


User avatar

Head_on_a_Stick

Posts: 13994
Joined: 2014-06-01 17:46
Location: /dev/chair
Has thanked: 53 times
Been thanked: 80 times

Re: ping reports «system error»

#2

Post

by Head_on_a_Stick » 2019-01-26 18:15

hbauer wrote:Any hint where I could start?

Enter the error message into your favorite search engine and follow the bread crumbs.

If you still can’t figure it out, post back listing everything you have tried in as much detail as possible so we don’t waste your time suggesting things you have already attempted.

Il semble que la perfection soit atteinte non quand il n’y a plus rien à ajouter, mais quand il n’y a plus rien à retrancher.





p.H

Section Moderator
Section Moderator
Posts: 3015
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 122 times

Re: ping reports «system error»

#6

Post

by p.H » 2019-01-27 11:24

What’s «myhostname» doing in the hosts: line ?

Edit : I first thought that it was a placeholder for the actual local host name, but there is really a NSS resolver library with this name…
Is the package libnss-myhostname installed ?
Did you try and move or remove each component in the line in turns and check what happens ?

When I have no clue, I run the command with strace to print system calls.


hbauer

Posts: 30
Joined: 2015-10-26 15:38

Re: ping reports «system error»

#7

Post

by hbauer » 2019-01-27 13:55

p.H wrote:Is the package libnss-myhostname installed ?
Did you try and move or remove each component in the line in turns and check what happens ?

I moved back to the original entry of nsswitch.conf which was

This is the same entry that is working on other boxes I am running so it should be good.

This is the first time I am working with strace and I might overlook important elements. But when I compare the output of strace on a working machine with my problematic box I see this

Code: Select all

open("/etc/nsswitch.conf", O_RDONLY|O_CLOEXEC) = -1 EACCES (Permission denied)
open("/etc/host.conf", O_RDONLY|O_CLOEXEC) = -1 EACCES (Permission denied)
getpid()                                = 477
open("/etc/resolv.conf", O_RDONLY|O_CLOEXEC) = -1 EACCES (Permission denied)

if ping is not able to read this 3 files I can imagine that things might not work. But on my filesystem the ACL looks good.

Code: Select all

ls -ls /etc/nsswitch.conf 
4 -rw-r--r-- 1 root root 532 Jan 27 14:59 /etc/nsswitch.conf

ls -ls /etc/resolv.conf 
4 -rw-r--r-- 1 root root 63 Jan 27 14:40 /etc/resolv.conf

ls -ls /etc/host.conf 
4 -rw-r--r-- 1 root root 9 Aug  7  2006 /etc/host.conf

Why should this ping process not be able to access this files?

Regards
Hagen



hbauer

Posts: 30
Joined: 2015-10-26 15:38

Re: ping reports «system error»

#9

Post

by hbauer » 2019-01-27 15:13

p.H wrote:Are other programs affected too ?

I cant say. I want to use this machine as icinga host and when ping is not working that does not make sense.

But there are no other obvious errors





p.H

Section Moderator
Section Moderator
Posts: 3015
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 122 times

Re: ping reports «system error»

#13

Post

by p.H » 2019-01-27 16:46

AFAIK, a firewall would not deny access to local files and block DNS queries from the local resolver library but allow those from nslookup.
Maybe SELinux or Apparmor ?


hbauer

Posts: 30
Joined: 2015-10-26 15:38

Re: ping reports «system error»

#14

Post

by hbauer » 2019-01-27 17:08

ping does also not work with local servers. And I can ping if I use the ip address. only pings via fqdn dont work. . Other hosts on the network can ping via fqdn.

I have not installed apparmor or selinux knowingly.


User avatar

bw123

Posts: 3940
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 10 times

Re: ping reports «system error»

#15

Post

by bw123 » 2019-01-27 17:38

hbauer wrote:
The system is running and allows me to login and install software.

Any hint where I could start?

You should start by checking the software you installed after using the guide. Or checking and undoing system changes you made. Nobody on here will know, you have access to the logs and you’re the one that made the changes.

Breaking a system tool and then asking what broke it isn’t really a good way to go about solving it. Post a lot of info, after you check it first, of course.

resigned by AI ChatGPT



hbauer

Posts: 30
Joined: 2015-10-26 15:38

Re: ping reports «system error»

#17

Post

by hbauer » 2019-01-27 17:44

bw123 wrote:
Breaking a system tool and then asking what broke it isn’t really a good way to go about solving it. Post a lot of info, after you check it first, of course.

This is right after the install. No additional stuff was installed. I can uninstall sudo or traceroute but I really believe this is not the root cause for this.



User avatar

bw123

Posts: 3940
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 10 times

Re: ping reports «system error»

#19

Post

by bw123 » 2019-01-27 18:00

hbauer wrote:

bw123 wrote:
Breaking a system tool and then asking what broke it isn’t really a good way to go about solving it. Post a lot of info, after you check it first, of course.

This is right after the install. No additional stuff was installed. I can uninstall sudo or traceroute but I really believe this is not the root cause for this.

So what installed mdns and added the [NOTFOUND=RETURN] stuff? was that in the guide somewhere? dnsutils pkg is needed for nslookup? All this was a fresh install?

sudo or traceroute not in guide either? How they got installed?

I don’t do the debootstrap thing, but I was thinking it should be a pretty tiny little base system, none of that would be installed?

resigned by AI ChatGPT



Должно быть так (только свои ip и dns подставь):

# ss -4tunap | grep -i «:53 «

udp    UNCONN      0       0          192.168.1.1:53              0.0.0.0:*      users:(("named",pid=3927,fd=514))                                             
udp    UNCONN      0       0            127.0.0.1:53              0.0.0.0:*      users:(("named",pid=3927,fd=513))                                             
tcp    LISTEN      0       10         192.168.1.1:53              0.0.0.0:*      users:(("named",pid=3927,fd=23))                                               
tcp    LISTEN      0       10           127.0.0.1:53              0.0.0.0:*      users:(("named",pid=3927,fd=22))

# dig @192.168.1.1 ya.ru

; <<>> DiG 9.11.28 <<>> @192.168.1.1 ya.ru
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 28101
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 5

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;ya.ru. IN A

;; ANSWER SECTION:
YA.ru. 430 IN A 87.250.250.242

;; AUTHORITY SECTION:
YA.ru. 2830 IN NS ns2.yandex.ru.
YA.ru. 2830 IN NS ns1.yandex.ru.

;; ADDITIONAL SECTION:
ns1.yandex.ru. 255922 IN A 213.180.193.1
ns2.yandex.ru. 255922 IN A 93.158.134.1
ns1.yandex.ru. 140 IN AAAA 2a02:6b8::1
ns2.yandex.ru. 1626 IN AAAA 2a02:6b8:0:1::1


# cat /var/lib/bind/etc/options.conf | grep -i forward

    //forward only;
forwarders { 213.234.0.2; 213.234.2.6; };
# service bind status

named is running
# dig @213.234.0.2 ya.ru

; <<>> DiG 9.11.28 <<>> @213.234.0.2 ya.ru
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 43199
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 5

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;ya.ru. IN A

;; ANSWER SECTION:
YA.ru. 362 IN A 87.250.250.242

;; AUTHORITY SECTION:
YA.ru. 1562 IN NS ns2.yandex.ru.
YA.ru. 1562 IN NS ns1.yandex.ru.

;; ADDITIONAL SECTION:
ns1.YANDEX.ru. 254650 IN A 213.180.193.1
ns2.YANDEX.ru. 254650 IN A 93.158.134.1
ns1.YANDEX.ru. 1937 IN AAAA 2a02:6b8::1
ns2.YANDEX.ru. 620 IN AAAA 2a02:6b8:0:1::1

;; Query time: 4 msec
;; SERVER: 213.234.0.2#53(213.234.0.2)
;; WHEN: Пн мая 24 15:50:09 MSK 2021
;; MSG SIZE  rcvd: 199

A failed ping test can also tell you a lot. Listing 13.10 shows a ping test failure. Listing 13.10: A Failed ping Test

PING 172.16.2.2 (172.16.2.2): 56 data bytes ping: sendto: Network is unreachable ping: wrote 172.16.2.2 64 chars, ret=-1 ping: sendto: Network is unreachable AC

3 packets transmitted, 0 packets received, 100% packet loss

Again, the test directs you to focus your troubleshooting efforts on certain layers of the network. A failure indicates you should focus on the network hardware, interface configuration, and lower-layer network services. The error message further helps refine that focus.

The specific text of ping error messages varies slightly, but the messages fall into three main categories:

Network unreachable This indicates that the local host does not have a valid route to the remote computer. (The next section looks at some tools that can help you try to track down a routing problem.) A related message that you might see in a ping test is ICMP Redirect, which is not really an error. An ICMP Redirect means that you have the wrong route in your routing table for this destination, and the local router is correcting your routing table.

No answer This indicates that the remote host did not respond to the ICMP Echo packets. On some systems, the Linux ping command does not display an error message saying No answer. Instead, the error «host unreachable» is displayed. In either case, however, when the ping is terminated, the summary line says 100% packet loss, which means that the remote host did not respond. No answer can be caused by many things. Any interruption of service anywhere on the network, from your host to the remote system, can cause this problem. This error means that no IP packets can successfully travel from your host to the remote host. Look for network errors.

Unknown host This indicates that name service was not able to resolve the hostname into an address. Possibly the user gave you the wrong hostname or the

DNS is misconfigured. Later in the chapter, tools for testing DNS servers are discussed.

ping is one of the best test tools available to the system administrator. Unfortunately, some sites block ICMP Echo messages at their firewalls or drop them at their routers. Every system that offers services to external users should respond to ping, even if those responses really come from a dedicated ping server sitting on the same network as the system that provides external services. The Internet works best when everyone works together. Unfortunately, bad people have frightened some administrators so much that we are losing some good tools. Interfering with ICMP Echo limits the effectiveness of one of the simplest and best test tools.

The results of the ping test guide you in the next phase of testing. ping directs you to focus on routing, DNS, or the application as the cause of the problem. Linux provides tools to test all of these things. The next section discusses the tools that let you test routing.

Continue reading here: Checking Socket Status with netstat

Was this article helpful?

Понравилась статья? Поделить с друзьями:
  • Pickit 2 vpp voltage level error check target retry operation
  • Pip install gdal error
  • Ping error code 1231
  • Pianoteq error loading plugin
  • Pip install fbprophet error