Build LNMPR Error — php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution

background
After installing Ubuntu subsystem in Win10 system, L(Linux)N(Nginx)M(mysql)P(PHP)R(Redis) environment was set up.
The error message
php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution
The screening process

    check whether the services of nginx, php-fpm and redis-server are started normally; sudo /etc/init.d/nginx status check whether win10 can ping the ubuntu subsystem; Check if Redis configuration is correct; Check that Hosts is configured correctly;
is finally determined that DNS cannot be resolved normally, and DNS configuration

needs to be modified
The solution
Gateway configuration:
, 1 sudo vi/etc/resolvconf resolv. Conf., d/base

# 添加下面网关(223.5.5.5 和 223.6.6.6 是阿里的网关)

nameserver 223.5.5.5
nameserver 223.6.6.6

2, sudo resolvconf-u will synchronize the configured DNS to /etc/resolv.conf
3, check vi /etc/resolv.conf whether there is a newly configured DNS
4. Restart PHP sudo /etc/init.d/php-fpm restart

Read More: