The new Ubuntu server uses netplan to manage the network configuration, which is very different from the previous configuration.
The practical solution is to modify the /etc/netplan/01-netcfg.yaml file:
sudo vim /etc/netplan/01-netcfg.yaml (the file name may be different for each server)
Execute the command sudo netplan apply to make the configuration take effect:
Then modify the DNS server address:
south you /etc/resolv.conf
Set as available DNS server