A combination of two problems: (1) Either my Mac or my iPhone has a Wi-Fi problem; and (2) the cell provider's DNS servers have issues.

Because of the second problem, I explicitly specify other servers for the iPhone Wi-Fi. But due to the first, I use the USB connection.

When the Mac thinks (right or wrong) that the Wi-Fi signal has disappeared, the USB connection remains good, but I can't reach web servers (except through Tor, which won't let me log in to S.E.) and mail has frequent failures.

The GUI lets me specify DNS servers explicitly for each Wi-Fi SSID or Bluetooth pair (but Bluetooth won't stay connected--again, I don't know whether it's the Mac or the phone).

But the GUI has no DNS settings for the USB connection, and I have not been able to find one in the 'defaults' settings. I could (maybe) use ipfw or iptables to redirect DNS queries but that would be a bit of a nuisance. Any other solution?

(Yeah, another cell provider, but Peru doesn't have many and I hate to toss what cost 120 soles on the hope that another is better.)

I suspect the wireless issues are in the Mac, because the iPad works much better. However, on the iPad, it frequently quits, but a quick off-and-on of both devices brings it back, while when the Mac Wi-Fi connection drops, it's gone for a long time. The phone SSID doesn't appear on the menu.

Another oddity is with rebooting the iPhone:

  1. Rebooting the iPhone gets the SSID to show up in the Wi-Fi list, but the Mac fails to connect.

  2. Rebooting the iPhone gets mail working again, but web browser still can't find hostnames.

  • I posted without log-in due to Tor, but then I realized I can log in if I suspend the NoScript for this site.
    – WGroleau
    Feb 27 '16 at 1:28
  • /etc/resolv.conf has a comment saying "most OS X processes" don't use it. However, when I brute force the name servers I want into it, the blackouts aren't happening. Safari, Mail, Thunderbird apparently do use it. The other workaround is to use Tor, where the exit node does the lookup.
    – WGroleau
    Feb 27 '16 at 22:45
  • I now have a local caching server, and a cron job that every five minutes changes /etc/resolv.conf to point to local. This greatly reduces the problem, but I would still like to control the DNS servers for USB connections.
    – WGroleau
    Feb 28 '16 at 14:28

The answer seems to be

sudo networksetup -setdnsservers "iPhone USB"  address  address  …

For more details, see How can I quickly change DNS server

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .