The DNS error maybe misleading. You generally get that error when the connection completely drops as well as when it can't talk to the DNS server. You could manually set the DNS in your pc to 8.8.8.8 That is a goggle dns that never will be down.
It is most likely your wifi is dropping for a short period of time. Many times windows not recover correctly. I would test for a while on ethernet to be sure it is the wifi causing it.
Wifi is really tricky to fix since it can be the router, the nic or in many cases interference from outside your house. But before you try to troubleshoot wifi be sure that is really your problem.