But it was not able to resolve DNS to IP address; in other words, I couldn't ping to google.com
It is actually very easy to fix and I am posting this for people who may have the same issue later.
Make sure your file, /etc/resolv.conf, has proper DNS servers. Most of time, your Internet Service Providers will provide at least one server automatically. But I use Google's DNS: their IP numbers are 18.104.22.168 and 22.214.171.124. They are reliable and easy to remember. Also unintuitive they are faster than what IPS gives you.
Modify the file, /etc/resolv.conf, and add two lines below like the screenshot above:
And test it if you can resolve DNS to IP address with "ping google.com"