1

I have an Ubuntu 18.04.3 server which started to not work correctly after a while. Every 10-15 hours I have to restart the network service in order to have outbound connections working.

I have a website hosted on the server. Everything works, but after a while connections to external websites (paypal, smtp, etc) always fail. The error is that DNS can't be resolved. So I tried to directly ping IP addresses from SSH, but fails too. I tried to dig +trace but fails too. All INBOUND connection (like SSH, connections to the web server, etc) works, but all OUTBOUND traffic fails after 10-15 hours. I cleared all iptables. I don't have any firewall installed.

To have again outbound connections I have to restart the server OR restart networking with sudo /etc/init.d/networking restart and it works for a while.

Here are some outputs:

$ cat /etc/network/interfaces
source /etc/network/interfaces.d/*

# The loopback network interface
auto lo ens192
iface lo inet loopback

# The primary network interface
allow-hotplug ens192
iface ens192 inet dhcp
iface ens192 inet6 manual
      pre-up sleep 5
      up dhclient -6 -nw -v ens192
      down dhclient -6 -r -v ens192
iface ens192:1 inet static
    address 195.110.124.133
    netmask 255.255.255.255
auto ens192:1
$ ifconfig -a
ens192: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 82.165.166.153  netmask 255.255.255.255  broadcast 82.165.166.153
        inet6 fe80::250:56ff:fe27:368f  prefixlen 64  scopeid 0x20<link>
        ether 00:50:56:27:36:8f  txqueuelen 1000  (Ethernet)
        RX packets 251345  bytes 169997864 (169.9 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 183239  bytes 92107852 (92.1 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens192:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 195.110.124.133  netmask 255.255.255.255  broadcast 195.110.124.133
        ether 00:50:56:27:36:8f  txqueuelen 1000  (Ethernet)

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 209410  bytes 383378140 (383.3 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 209410  bytes 383378140 (383.3 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.255.255.1    0.0.0.0         UG    0      0        0 ens192
10.255.255.1    0.0.0.0         255.255.255.255 UH    0      0        0 ens192
$ iptables -L -n -v
Chain INPUT (policy ACCEPT 305K packets, 356M bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain OUTPUT (policy ACCEPT 264K packets, 321M bytes)
 pkts bytes target     prot opt in     out     source               destination 

I really don't know what to do. To me it seems that everything is ok.

EDIT 1

I checked system log files and found the moment when outbound connections stop working

Oct 02 05:10:16 localhost dhclient[701]: DHCPREQUEST of 82.165.166.153 on ens192 to 255.255.255.255 port 67 (xid=0x21426427)
Oct 02 05:10:18 localhost systemd[1]: Stopping Network Name Resolution...
Oct 02 05:10:18 localhost systemd[1]: Stopped Network Name Resolution.
Oct 02 05:10:18 localhost systemd[1]: Starting Network Name Resolution...
Oct 02 05:10:18 localhost systemd-resolved[72821]: Positive Trust Anchors:
Oct 02 05:10:18 localhost systemd-resolved[72821]: . IN DS 19036 8 2 49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5
Oct 02 05:10:18 localhost systemd-resolved[72821]: . IN DS 20326 8 2 e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d
Oct 02 05:10:18 localhost systemd-resolved[72821]: Negative trust anchors: 10.in-addr.arpa 16.172.in-addr.arpa 17.172.in-addr.arpa 18.172.in-addr.arpa 19.172.in-addr.arpa 20.172.in-addr.arpa 21.172.in-addr.arpa 22.172.in-addr.arpa 23.172.in-addr.arpa 24.172.in-addr.arpa 25.172.in-addr.arpa 26.172.in-addr.arpa 27.172.in-addr.arpa 28.172.in-addr.arpa 29.172.in-addr.arpa 30.172.in-addr.arpa 31.172.in-addr.arpa 168.192.in-addr.arpa d.f.ip6.arpa corp home internal intranet lan local private test
Oct 02 05:10:18 localhost systemd-resolved[72821]: Defaulting to hostname 'linux'.
Oct 02 05:10:18 localhost systemd[1]: Started Network Name Resolution.
Oct 02 05:10:18 localhost systemd[1]: Starting resolvconf-pull-resolved.service...
Oct 02 05:10:18 localhost named[979]: no longer listening on 82.165.166.153#53
Oct 02 05:10:18 localhost systemd[1]: Started resolvconf-pull-resolved.service.
Oct 02 05:10:18 localhost dhclient[701]: DHCPDISCOVER on ens192 to 255.255.255.255 port 67 interval 3 (xid=0x420a5400)
Oct 02 05:10:18 localhost dhclient[701]: DHCPREQUEST of 82.165.166.153 on ens192 to 255.255.255.255 port 67 (xid=0x540a42)
Oct 02 05:10:18 localhost dhclient[701]: DHCPOFFER of 82.165.166.153 from 10.255.243.13
Oct 02 05:10:18 localhost dhclient[701]: DHCPACK of 82.165.166.153 from 10.255.243.13
Oct 02 05:10:18 localhost systemd[1]: Reloading Samba SMB Daemon.
Oct 02 05:10:18 localhost systemd[1]: Reloaded Samba SMB Daemon.
Oct 02 05:10:18 localhost named[979]: listening on IPv4 interface ens192, 82.165.166.153#53
Oct 02 05:10:18 localhost systemd[1]: Stopping Network Name Resolution...
Oct 02 05:10:18 localhost systemd[1]: Stopped Network Name Resolution.
Oct 02 05:10:18 localhost systemd[1]: Starting Network Name Resolution...
Oct 02 05:10:18 localhost systemd-resolved[72855]: Positive Trust Anchors:
Oct 02 05:10:18 localhost systemd-resolved[72855]: . IN DS 19036 8 2 49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5
Oct 02 05:10:18 localhost systemd-resolved[72855]: . IN DS 20326 8 2 e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d
Oct 02 05:10:18 localhost systemd-resolved[72855]: Negative trust anchors: 10.in-addr.arpa 16.172.in-addr.arpa 17.172.in-addr.arpa 18.172.in-addr.arpa 19.172.in-addr.arpa 20.172.in-addr.arpa 21.172.in-addr.arpa 22.172.in-addr.arpa 23.172.in-addr.arpa 24.172.in-addr.arpa 25.172.in-addr.arpa 26.172.in-addr.arpa 27.172.in-addr.arpa 28.172.in-addr.arpa 29.172.in-addr.arpa 30.172.in-addr.arpa 31.172.in-addr.arpa 168.192.in-addr.arpa d.f.ip6.arpa corp home internal intranet lan local private test
Oct 02 05:10:18 localhost systemd-resolved[72855]: Defaulting to hostname 'linux'.
Oct 02 05:10:18 localhost systemd[1]: Started Network Name Resolution.
Oct 02 05:10:18 localhost systemd[1]: Starting resolvconf-pull-resolved.service...
Oct 02 05:10:18 localhost systemd[1]: Started resolvconf-pull-resolved.service.
Oct 02 05:10:18 localhost dhclient[701]: bound to 82.165.166.153 -- renewal in 20130 seconds.
Oct 02 05:10:23 localhost freshclam[929]: Wed Oct  2 05:10:23 2019 -> Received signal: wake up
Oct 02 05:10:23 localhost freshclam[929]: Wed Oct  2 05:10:23 2019 -> ClamAV update process started at Wed Oct  2 05:10:23 2019
Oct 02 05:10:40 localhost plesk_saslauthd[72813]: select timeout, exiting
Oct 02 05:10:48 localhost dhclient[755]: XMT: Solicit on ens192, interval 118130ms.
Oct 02 05:10:48 localhost dhclient[755]: RCV: Advertise message on ens192 from fe80::250:56ff:fea8:c43.
Oct 02 05:10:48 localhost dhclient[755]: RCV: Advertise message on ens192 from fe80::250:56ff:fe8b:e07d.
Oct 02 05:10:55 localhost systemd-resolved[72855]: Using degraded feature set (UDP) for DNS server 8.8.8.8.

Why the Network Name Resolution is restarting?

6
  • journalctl /usr/sbin/NetworkManager will show you interesting log messages.
    – waltinator
    Oct 2 '19 at 12:55
  • your gateway is in a different network than the ens192 interface Oct 2 '19 at 13:14
  • @waltinator I don't have NetworkManager installed.
    – SebaSbs
    Oct 2 '19 at 14:27
  • @DamirNemčanin yes, but why sometimes it's working and sometimes not? I updated the main thread with more logs.
    – SebaSbs
    Oct 2 '19 at 14:28
  • @SebaSbs who is serving a DHCP for your server? Oct 2 '19 at 21:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.