I'm trying to setup custom A records for domains via /etc/hosts on my OSX 10.13.2 MBP.

It usually works just fine, first time that it works only for 1 of the 2 domains:

  • dev.com (works; points to
  • admin.dev.com (doesn't work; points to live IP

I tried flushing DNS cache as well without success using:

sudo dscacheutil -flushcache

Pinging both domains returns 100% packet loss

PING dev.com ( 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
Request timeout for icmp_seq 5

Also tried different browsers (Opera, Firefox, Safari) as I know Chrome is pretty agressive with DNS caching.

Any idea?

EDIT: IP adresses and domains are pure fiction here.

  • Try using: sudo killall -HUP mDNSResponder Commented Jan 8, 2018 at 21:27
  • It depends on whether is a placeholder in your question only. The real addresses (or are defunct/filtered because a lot of people use it as placeholders. ping sld.tld ( really times out!
    – klanomath
    Commented Jan 8, 2018 at 23:33
  • @user3439894; seems like killing the process worked it's magic! @klanomath; indeed, it was just for the example :)
    – pycvalade
    Commented Jan 9, 2018 at 15:24

1 Answer 1


Based on @user3439894 comment to the original question, directly killing mDNSResponder processes fixed the issue for me.

Command used was:

sudo killall -HUP mDNSResponder

From the killall manual page:

killall sends a signal to all processes running any of the specified commands. If no signal name is specified, SIGTERM is sent.

Signals can be specified either by name (e.g. -HUP or -SIGHUP ) or by number (e.g. -1) or by option -s.

You must log in to answer this question.

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