Gmail and facebook work because they use IPv6 (you will find the google and youtube will also work). So why is IPv4 not working? Try this:
1. Ping your router. "Ping 192.168.1.1" (or what ever the address for gateway is in ipconfig). If this works, then it's not your computer.
2. Ping google. "Ping 172.217.14.174" ... if this works then it's not a network issue, but more likely a DNS issue.
3. Go into your network adapter properties and under IPv4 manually enter a DNS server address ... 8.8.8.8 ... like
this.