Remove custom dns server setting via command line [duplicate]

Solution 1:

Here's a one liner and the thread where I learned this a while back:

sudo networksetup -setdnsservers Wi-Fi "Empty"

After using `networksetup -setdnsservers Wi-Fi "8.8.8.8" "8.8.4.4"` how do I clear them?