Ubuntu: Ubuntu Server 17.10 PHP 7.1 DNS resolution issues


I recently deployed a couple Artful servers to AWS. While the existing Yakkety and Zesty servers are fine, the Artful servers have intermittent problems resolving DNS. The only place I've seen the issue so far is in the PHP error logs like php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution, but that could just be because that's where the lookups are coming from.

This is a mostly vanilla Amazon distribution of Ubuntu; the primary difference from the Amazon provided distribution is that I've run the release upgrades to get to Artful.

I'm at a loss as to figure out even what component is the problem, whether it's systemd-resolved, php7.1-fpm (older servers run 7.0), or something in the Ubuntu distribution.

The DNS lookups I am performing would generally be going to one of Amazon's Route 53 private zones. It works most of the time, so everything seems to be configured properly.

This is what a typical DNS lookup looks like:

> nslookup db  Server:  Address:    Non-authoritative answer:  db.example.local    canonical name = sql01.example.local.  Name:   sql01.example.local  Address:  

And this is what systemd sees:

> systemd-resolve --status  Global       DNS Servers:        DNS Domain: example.local        DNSSEC NTA: 10.in-addr.arpa                    16.172.in-addr.arpa                    168.192.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                    corp                    d.f.ip6.arpa                    home                    internal                    intranet                    lan                    local                    private                    test    Link 2 (ens3)        Current Scopes: LLMNR/IPv4 LLMNR/IPv6         LLMNR setting: yes  MulticastDNS setting: no        DNSSEC setting: no      DNSSEC supported: no  

Regarding network configuration, I have touched nothing, except that I set the hostname with hostnamectl set-hostname foo.example.local. /etc/resolv.conf is auto-generated, /etc/systemd/resolved.conf has only commented defaults:

[Resolve]  #DNS=  #FallbackDNS=  #Domains=  #LLMNR=yes  #MulticastDNS=yes  #DNSSEC=no  #Cache=yes  #DNSStubListener=udp  

In terms of volume, we are performing thousands or perhaps tens of thousands of lookups per minutes, with a failure rate of around 25 per hour. This may not seem very high, but it is 0 on Zesty and Yakkety. And the low incidence rate makes it very difficult to test any fixes with any confidence.

I have found tons of bug reports for both PHP and Ubuntu related DNS resolution, but most come back with an old glibc bug, or conflicts when trying to not use systemd. Additionally, I have found lots of suggestions related to NetworkManager, but Ubuntu Server does not use that.

As a workaround, I've added host entries, but that's not tenable long-term.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »