Online upgrade leap 15.0 to 15.1, then DNS does not work well any more.

It is OK to do “ping 8.8.8.8”, but failed to do “ping www.google.com”. I captured the packets using wireshark, it shows there is not any DNS request when running “ping www.google.com”. But the file /etc/resolv.conf is normal, there are DNS servers listed.“nslookup” work well, that can give the ip for internet domain. Firefox does not work,either.
I tried to add download.opensuse.org to /etc/hosts, “zypper ref” can reach the website, but can not refresh the package information due to some errors just like “|] Valid metadata not found at specified URL(s)”.
Now the issued pc can not use internet by web browser, nor online update. Please help me.

Are you using NetworkManager to connect or wicked? Perhaps try removing /etc/resolv.conf (admin privileges required) and reboot. Does that help?

Each thing you described is something different.

When you did a “ping www.google.com” you should paste the command and result into your post, surrounded with

 tags (The hash button if you're posting using the Web text editor). Exactly what it says will tell us what caused the unsuccessful ping.

You shouldn't need to add download.opensuse.org to /etc/hosts (and you wouldn't successfully unless you knew its IP address). Adding an incorrect entry in any way can actually make name resolution impossible, so remove this if it's still in your /etc/hosts file.

The error about not finding valid metadata does not mean that you have a name resolution functionality problem, but an incorrect hosts file entry is one way that can cause that error. See what I just posted previous to this.

In fact, inspect your /etc/hosts file, it should have no more than an entry for localhost and possibly entries (IPv4 and possibly IPv6) for your machine's hostname..If you see any entries for anything else, particularly Internet names, those were likely created by you and should be removed. If you feel unsure about actually deleting any entries, the file should contain plenty of examples of prepending lines with at least one hash (#) to disable that line.

When your machine is hopefully returned to a state before you started messing around with files, run the following and post each command's.

nslookup


Now, with the nslookup command prompt (when done, you can exit by typing "quit" or "exit")
Perform each of the following commands, and post the command with its result

The following tests a well known domain name. The result should be a successful non-authoritative answer using your currently configured DNS server. You can use any well known domain name, but never use a very unusual Domain name that wouldn't likely be cached on the DNS servers you're currently using (because then there would be a long delay for a search to find the name you're asking for which might time out)

www.google.com


Particularly if the above is unsuccessful, then do the following which switches to the Google Servers

server 8.8.8.8


And then repeat the test querying for a domain name

www.google.com


Because you're pointing to Google DNS and asking for a name in the Google domain, your result should be a successful authoritative answer.

If your test pointing to your original DNS fail but succeed when pointing to the Google DNS servers, then that means your original DNS servers are unreliable. Modify your network settings (Network Manager or YaST/Wicked) to make your DNS settings permanent.

TSU

I tried both of them, the same issue happened. when using NetworkManager, /etc/resolv.conf looks nothing special, there are DNS servers listed in it, even I removed it, a same file will be generated after reboot or use command

netconfig -f update

Because nslookup works, I think it may be a different issuse.

Sorry for the poor format. My pc can not access internet regularly, so I use another pc else and can not paste the original output now.

Then it looks comfused, nslookup works, I can find the IP of download.opensuse.org and add it to /etc/hosts manually. In wicked, I need to add 8.8.8.8 to DNS configuration, and in NetworkManger, I need do nothing, there is DNS information in /etc/resolv.conf. But ping and firefox don’t work. After I added download.opensuse.org, I can access it in firefox. I will post those results of the commands later.

Perhaps check your NSS configuration in /etc/nsswitch.conf…

grep -i hosts /etc/nsswitch.conf

and make sure that ‘dns’ is configured there.

Thank you very much, I checked /etc/nsswitch.conf.

#grep -i hosts /etc/nsswitch.conf
hosts:      files mdns_minimal [NOTFOUND=return] dns

And the results of other commands are posted below. Please help me to solve the issue.

 # ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=51 time=109 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=51 time=78.2 ms
^C
--- 8.8.8.8 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 78.261/93.739/109.217/15.478 ms

# dig www.google.com

; <<>> DiG 9.11.2 <<>> www.google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 27051
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1280
;; QUESTION SECTION:
;www.google.com.            IN    A

;; ANSWER SECTION:
www.google.com.        65    IN    A    216.58.197.132

;; Query time: 98 msec
;; SERVER: 192.168.42.129#53(192.168.42.129)
;; WHEN: Tue Jun 04 22:16:20 JST 2019
;; MSG SIZE  rcvd: 59

# ping www.google.com
ping: www.google.com: Name or service not known

# ifconfig
eth0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 7c:05:07:a1:35:cc  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 10825  bytes 897225 (876.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 10825  bytes 897225 (876.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.42.193  netmask 255.255.255.0  broadcast 192.168.42.255
        inet6 fe80::e9a8:bf8d:2838:56ff  prefixlen 64  scopeid 0x20<link>
        ether ca:98:5b:fb:c0:ec  txqueuelen 1000  (Ethernet)
        RX packets 42  bytes 5186 (5.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 49  bytes 13556 (13.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.43.172  netmask 255.255.255.0  broadcast 192.168.43.255
        inet6 fe80::26fd:52ff:fe58:6300  prefixlen 64  scopeid 0x20<link>
        ether 24:fd:52:58:63:00  txqueuelen 1000  (Ethernet)
        RX packets 10  bytes 1574 (1.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 38  bytes 8628 (8.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

# cat /etc/resolv.conf
### /etc/resolv.conf is a symlink to /var/run/netconfig/resolv.conf
### autogenerated by netconfig!
#
# Before you change this file manually, consider to define the
# static DNS configuration using the following variables in the
# /etc/sysconfig/network/config file:
#     NETCONFIG_DNS_STATIC_SEARCHLIST
#     NETCONFIG_DNS_STATIC_SERVERS
#     NETCONFIG_DNS_FORWARDER
# or disable DNS configuration updates via netconfig by setting:
#     NETCONFIG_DNS_POLICY=''
#
# See also the netconfig(8) manual page and other documentation.
#
### Call "netconfig update -f" to force adjusting of /etc/resolv.conf.
nameserver 192.168.42.129
nameserver 192.168.43.1

# cat /etc/nsswitch.conf
#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Legal entries are:
#
#       compat                  Use compatibility setup
#       nisplus                 Use NIS+ (NIS version 3)
#       nis                     Use NIS (NIS version 2), also called YP
#       dns                     Use DNS (Domain Name Service)
#       files                   Use the local files
#       [NOTFOUND=return]       Stop searching if not found so far
#
# For more information, please read the nsswitch.conf.5 manual page.
#

# passwd: files nis
# shadow: files nis
# group:  files nis

passwd: compat
group:  compat

hosts:      files mdns_minimal [NOTFOUND=return] dns
networks:    files dns

services:    files
protocols:    files
rpc:        files
ethers:        files
netmasks:    files
netgroup:    files nis
publickey:    files

bootparams:    files
automount:    files nis
aliases:    files

# cat /etc/hosts
#
# hosts         This file describes a number of hostname-to-address
#               mappings for the TCP/IP subsystem.  It is mostly
#               used at boot time, when no name servers are running.
#               On small systems, this file can be used instead of a
#               "named" name server.
# Syntax:
#    
# IP-Address  Full-Qualified-Hostname  Short-Hostname
#

127.0.0.1    localhost

# special IPv6 addresses
::1             localhost ipv6-localhost ipv6-loopback

fe00::0         ipv6-localnet

ff00::0         ipv6-mcastprefix
ff02::1         ipv6-allnodes
ff02::2         ipv6-allrouters
ff02::3         ipv6-allhosts
195.135.221.134    download.opensuse.org

# zypper ref
Retrieving repository 'home:lrupp' metadata --------------------------------------------------------------------------------------------------------------------------------------------------------------Retrieving repository 'home:lrupp' metadata --------------------------------------------------------------------------------------------------------------------------------------------------------------Retrieving repository 'home:lrupp' metadata --------------------------------------------------------------------------------------------------------------------------------------------------------------Retrieving repository 'home:lrupp' metadata --------------------------------------------------------------------------------------------------------------------------------------------------------------Retrieving repository 'home:lrupp' metadata ..............................................................................................................................................................................[error]
Repository 'home:lrupp' is invalid.
[http-download.opensuse.org-69ef4451|http://download.opensuse.org/repositories/home:/lrupp/openSUSE_Leap_15.1/] Valid metadata not found at specified URL
Please check if the URIs defined for this repository are pointing to a valid repository.
Skipping repository 'home:lrupp' because of the above error.
Retrieving repository 'filesystems' metadata -------------------------------------------------------------------------------------------------------------------------------------------------------------Retrieving repository 'filesystems' metadata -------------------------------------------------------------------------------------------------------------------------------------------------------------Retrieving repository 'filesystems' metadata -------------------------------------------------------------------------------------------------------------------------------------------------------------Retrieving repository 'filesystems' metadata -------------------------------------------------------------------------------------------------------------------------------------------------------------Retrieving repository 'filesystems' metadata .............................................................................................................................................................................[error]
Repository 'filesystems' is invalid.
[http-download.opensuse.org-af6b10a1|http://download.opensuse.org/repositories/filesystems/openSUSE_Leap_15.1/] Valid metadata not found at specified URL
Please check if the URIs defined for this repository are pointing to a valid repository.
Skipping repository 'filesystems' because of the above error.
Problem retrieving files from 'Packman Repository'.
Download (curl) error for 'http://packman.inode.at/suse/openSUSE_Leap_15.1/repodata/repomd.xml':
Error code: Connection failed
Error message: Could not resolve host: packman.inode.at

Please see the above error message for a hint.
Skipping repository 'Packman Repository' because of the above error.
Repository 'openSUSE-Leap-15.1-Non-Oss' is up to date.                                                                                                                                                                           
Repository 'openSUSE-Leap-15.1-Oss' is up to date.                                                                                                                                                                               
Retrieving repository 'openSUSE-Leap-15.1-Update' metadata -----------------------------------------------------------------------------------------------------------------------------------------------Retrieving repository 'openSUSE-Leap-15.1-Update' metadata -----------------------------------------------------------------------------------------------------------------------------------------------Retrieving repository 'openSUSE-Leap-15.1-Update' metadata -----------------------------------------------------------------------------------------------------------------------------------------------Retrieving repository 'openSUSE-Leap-15.1-Update' metadata ...............................................................................................................................................................[error]
Repository 'openSUSE-Leap-15.1-Update' is invalid.
[repo-update|http://download.opensuse.org/update/leap/15.1/oss/] Valid metadata not found at specified URL
Please check if the URIs defined for this repository are pointing to a valid repository.
Skipping repository 'openSUSE-Leap-15.1-Update' because of the above error.
Repository 'openSUSE-Leap-15.1-Update-Non-Oss' is up to date.                                                                                                                                                                    
Some of the repositories have not been refreshed because of an error.

#

The nsswitch.conf config looks as expected. Does /etc/host.conf contain the following?

order hosts, bind

Remove [NOTFOUND=return] form this line. It causes host name lookups to skip DNS resolution. Most likely you do not need mdns_minimal at all.

Thank you for advice, I have tried before moving dns like below and reboot, but nothing changed, I’ll try removing [NOTFOUND=return] later.

hosts:      dns files mdns_minimal [NOTFOUND=return] 

Care to elaborate further? I’ve never found that to impact in the way you describe, and my current working configuration has it (for years).

The ‘[NOTFOUND=return]’ directive applied after the mdns_minimal entry is used to prevent a failed *.local name resolution (via nss-mdns module) then being tried using the nss-dns module.

I checked the /etc/host.conf, there is the line above there. I solved the question in the way below.

I don’t know what /etc/NetworkManager/NetworkManager.conf should be, but after adding dns=dnsmasq under [main] in it and reboot, the issue is solved.

In my case here, it looks not the reason. I did as what you said, but nothing changed. And I have solved the question in the way below.

This reads more like a workaround than a solution as such, (but good to read of your progress with this anyway.) It is a simple DNS server/forwarder and NetworkManager can be configured to use it instead of configuring to use your DNS servers directly (obtained via dhclient by default).