Changing DNS settings on PS4 is pretty simple. All you need to do is follow some steps, which include heading to the Settings -> Network -> Set Up an Internet Connection -> LAN/ Wi-Fi-> Custom -> Choose Ip address as Automatic, proxy PS4 port as manual, and DHCP as Do Not Specify.
Now Use Automatic -> MTU settings -> Manual -> choose the preferred DNS for Primary and Secondary DNS bar.