From the output, you don’t have any routing rules for your machine that block outgoing traffic. The dig command confirms that you can talk to servers. 9.9.9.9 is a common DNS Server. Based off of this, it seems like your problem is that your system has a bad DNS configuration (it’s always DNS).
Can you parhaps cat /etc/resolv.con
? This file normally contains the used DNS servers for Linux systems, unless using special software.
Okay, no external software for DNS management present here. Is that ip a working DNS Server? Is it your server itself perhaps?