How to Limit Traffic Generated by mDNSResponder on macOS

dnsmacosNetwork

Using the activity monitor, I can observe that mDNSResponder has sent, after a while, 595 KB and received 313.8 MB.

Some details about my network topology: I connect with WiFi to an Android phone and a Windows 8 computer was on the same local network. I’d like to know if an any situation this would use tethering data which can be costly in some countries per MB sent/received.

I know that mDNSResponder is a legitimate macOS process.

My question is how can I limit the traffic generated by mDNSResponder in order to avoid it running up a data bill.

Is this possible?

Best Answer

Despite its name, mDNSResponder handles both local multicast DNS ("mDNS", which will not be adding to your cell bill), and regular unicast DNS (which is not generally local, and will be adding to your cell bill). The figures in Activity Monitor don't distinguish between the two. My guess is that most of the traffic is local (mDNS is a bit chatty), but you'd have to run some tests to be sure.

There is a way to cut down on actual DNS traffic: a lot of the DNS lookups your computer is doing are probably from web ads, and some forms of ad blocking will prevent those lookups. Unfortunately, I haven't looked at this in a while, and don't know which types of blockers work early enough to prevent the DNS lookup. Essentially, there are three levels at which a blocker can work:

  • Detect and block ad content very early, and block fetching the ad content before the DNS lookup is done (leading to minimal network traffic).
  • Detect and block ad content after the lookup is done, but before the ad content is fetched (leading to slightly more network traffic).
  • Detect and block ad content after it is fetched (leading to full network traffic, ads just aren't displayed).

One ad-blocking method that's guaranteed to work at the first level is installing an alternate /etc/hosts file with faked entries for known advertising server domains. There are a variety of these available, for instance at Steven Black's github (which has a bunch of them with different groups of servers, also has scripts for building your own). If you want to do this, there are installation instructions here, although I'll add one step: make a backup copy of the original /etc/hosts file first!