T
T
tutnet2014-02-05 11:28:15
Domain Name System
tutnet, 2014-02-05 11:28:15

Why doesn't redirect via hosts work on macos?

We have a laptop with an extreme macos, a site located on mydomen.ru
and a development server located in my subnet at 192.168.1.XX
I have it in hosts
192.168.1.XX mydomen.ru
In chrome, in any case, it opens from the Internet. In safari, by default, it opens from the Internet, but if you go by IP address, then it opens a couple of times and by url, and then again pulls from the Internet. Through the terminal, it pings what is needed by the domain name (internal server), ssh from the terminal also works correctly, but browsers do not want to.
Windows machines in the same network have no problems - everyone goes where hosts points
. I suspect some kind of malicious dns caching. How to deal with it?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
Tonis Simo, 2014-02-05
@estum

Faced this problem. I don’t remember exactly how I decided, but installing dnsmasq via Homebrew seemed to help.
In my /etc/resolv.dnsmasq.conf :

order hosts, bind
nameserver 8.8.8.8
nameserver 8.8.4.4

S
Sergey Sokolov, 2014-02-05
@sergiks

Makosi has two name resolvers, and different programs resolve names differently. I made myself such a script to “true” reset the name cache:

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist

sudo dscacheutil -flushcache
dscacheutil -flushcache   # на всякий случай: не знаю, глобален ли этот кэш

2
26info, 2014-02-09
@26info

Clear the browser cache, if you use the webdeveloper add-on (available for firefox and chrome), then you can disable the dns cache in it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question