Ubuntu 20.04 /etc/network/interfaces and ifupdown not connecting to internet

As described in many askUbuntu forum posts, I installed ifupdown and removed/purged netplan.io. While now ifconfig and ip a yield the settings from /etc/network/interfaces (copied from an Ubuntu installation circa 2013, only updated eth0 in the files to enp4s0), there still is no internet. Some connection does appear to be there though, i.e. it recognizes printers on the local network.

ping google.com 

returns Temporary failure in name resolution. However, ping 8.8.8.8 works fine.

System: Ubuntu 20.04.3 LTS (Focal Fossa)

What could be at play here?

ifconfig:

enp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.31  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::a6ba:dbff:fe03:2e44  prefixlen 64  scopeid 0x20<link>
        inet6 2607:fea8:3e80:64a:a6ba:dbff:fe03:2e44  prefixlen 64  scopeid 0x0<global>
        ether a4:ba:db:03:2e:44  txqueuelen 1000  (Ethernet)
        RX packets 3128  bytes 483360 (483.3 KB)
        RX errors 0  dropped 16  overruns 0  frame 0
        TX packets 482  bytes 84822 (84.8 KB)
        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
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 2836  bytes 217982 (217.9 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2836  bytes 217982 (217.9 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Solution 1:

The /etc/resolv.conf file was set incorrectly. Simply copying the /etc/resolv.conf file from the previous 2013 Ubuntu version did the trick. namely:

domain 'URL address'
search 'URL address'
nameserver 'IP address'
nameserver 'IP address'