For a few days my ps4 can no longer connect to the internet due to a DNS error. When I test the internet connection, the "internet connection" fails, unfortunately I can't enter an exact error code because a different code is displayed each time, I will now list what I have already tried:
The Ps4 restarted
The ps4 was taken off power for several hours
The ps4 reset to default settings
Rebuilt the database using security mode.
The primary and secondary DNS changed (to codes recommended to me on the internet)
Try contacting Sony support.