/etc/hosts changes aren’t getting reflected on Mac

I've a Spring Boot application which uses an external service. I want to reproduce a scenario where that service is not reachable after my application is up and running.

So, I thought I'll start my service and update the /etc/hosts entry to block the outgoing calls to that service. Somehow this is not working for my Mac.

This is how the URL of that external service looks like:


And this is the entry of /etc/hosts:

# Host Database
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##       localhost broadcasthost
::1             localhost

# Block external service calls         pulsar+ssl://a943.chat.extservice.com:6951?preset=low_tp_no_read         a943.chat.extservice.com         pulsar+ssl://a943.chat.extservice.com:6951         a943.chat.extservice.com:6951

I tried adding all possible combinations but this is not working. Even I blocked google.com, but still I was able to access it.

Any suggestions or help would be really appreciated.


Author: Subham

Leave a Reply

Your email address will not be published. Required fields are marked *