How to get rid of "ghost" DNS servers

Below says a USG device stores double or old names in /etc/hosts:

EDIT: Ow USG = Unifi Security Gateway from Ubiquiti