iMac connected to wifi/ethernet but can't access internet
My iMac 27" late 2015 has just decided it won't access the internet through any application.
The router is fine, all other devices are connecting and working ok either through ethernet or wifi connection so it's a problem with the mac.
I've turned the wifi on/off. Renewed DHCP Lease under the TCP/IP settings. Deleted all browser history. Run diagnostics. When I reset the computer there is a very brief moment I can connect to a website and load up an page, then I can't load anything else and the computer is not connected to the internet.
Any help would be really appreciated.
Is this a keychain issue?
Thanks
iMac 27", macOS 10.14