/etc/hosts not working on macOS 10.13OSX Sierra hosts file is ignoredWindows 7 etc/hosts file broken?Why does...
Why is "la Gestapo" feminine?
Exposing a company lying about themselves in a tightly knit industry: Is my career at risk on the long run?
Do people actually use the word "kaputt" in conversation?
What is it called when someone votes for an option that's not their first choice?
Print last inputted byte
What is the tangent at a sharp point on a curve?
Jem'Hadar, something strange about their life expectancy
How do researchers send unsolicited emails asking for feedback on their works?
Why is participating in the European Parliamentary elections used as a threat?
Unfrosted light bulb
Is "inadequate referencing" a euphemism for plagiarism?
Have any astronauts/cosmonauts died in space?
Fair way to split coins
Interior of Set Notation
Air travel with refrigerated insulin
Justification failure in beamer enumerate list
What are the rules for concealing thieves' tools (or items in general)?
Should I be concerned about student access to a test bank?
Why doesn't the fusion process of the sun speed up?
is this saw blade faulty?
When did hardware antialiasing start being available?
Turning a hard to access nut?
Can other pieces capture a threatening piece and prevent a checkmate?
Determine voltage drop over 10G resistors with cheap multimeter
/etc/hosts not working on macOS 10.13
OSX Sierra hosts file is ignoredWindows 7 etc/hosts file broken?Why does editing my hosts file to block websites show them as LISTENING?Simulate manipulation of the etc/hosts file in Google ChromeWhy can't I block Facebook using /etc/hosts on Mountain Lion (OS X)?Hosts file changes are not recognized in Windows 8Hosts file on Mountain Lion stopped working suddenlyHosts file redirect to domainWhy isn't /etc/hosts blocking domains after I add blocked sites via launchd?Unable to redirect a website by modifying etc/hosts fileRedirecting domains in /etc/hosts
I tried to use /etc/hosts
file to redirect some websites to localhost.
To do so, I opened it in terminal using sudo nano /etc/hosts
then I modified the file, and saved it. As the last step I flushed the DNS cache with sudo killall -HUP mDNSResponder
.
Here's what my hosts file looks like:
$ cat /etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 somethig.com
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
This simply doesn't work. I tried to reboot, without luck. I also did a lot of research but did not find any working answers on the internet. Does the OS still use this file, or will this never really work?
I'm using macOS 10.13.
macos hosts-file macos-highsierra
add a comment |
I tried to use /etc/hosts
file to redirect some websites to localhost.
To do so, I opened it in terminal using sudo nano /etc/hosts
then I modified the file, and saved it. As the last step I flushed the DNS cache with sudo killall -HUP mDNSResponder
.
Here's what my hosts file looks like:
$ cat /etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 somethig.com
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
This simply doesn't work. I tried to reboot, without luck. I also did a lot of research but did not find any working answers on the internet. Does the OS still use this file, or will this never really work?
I'm using macOS 10.13.
macos hosts-file macos-highsierra
Does OSX Sierra hosts file is ignored help?
– Andrew Morton
Mar 6 '18 at 18:50
add a comment |
I tried to use /etc/hosts
file to redirect some websites to localhost.
To do so, I opened it in terminal using sudo nano /etc/hosts
then I modified the file, and saved it. As the last step I flushed the DNS cache with sudo killall -HUP mDNSResponder
.
Here's what my hosts file looks like:
$ cat /etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 somethig.com
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
This simply doesn't work. I tried to reboot, without luck. I also did a lot of research but did not find any working answers on the internet. Does the OS still use this file, or will this never really work?
I'm using macOS 10.13.
macos hosts-file macos-highsierra
I tried to use /etc/hosts
file to redirect some websites to localhost.
To do so, I opened it in terminal using sudo nano /etc/hosts
then I modified the file, and saved it. As the last step I flushed the DNS cache with sudo killall -HUP mDNSResponder
.
Here's what my hosts file looks like:
$ cat /etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 somethig.com
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
This simply doesn't work. I tried to reboot, without luck. I also did a lot of research but did not find any working answers on the internet. Does the OS still use this file, or will this never really work?
I'm using macOS 10.13.
macos hosts-file macos-highsierra
macos hosts-file macos-highsierra
edited Mar 6 '18 at 18:56
Andrew Morton
2,16121124
2,16121124
asked Mar 6 '18 at 18:42
dnnagydnnagy
10612
10612
Does OSX Sierra hosts file is ignored help?
– Andrew Morton
Mar 6 '18 at 18:50
add a comment |
Does OSX Sierra hosts file is ignored help?
– Andrew Morton
Mar 6 '18 at 18:50
Does OSX Sierra hosts file is ignored help?
– Andrew Morton
Mar 6 '18 at 18:50
Does OSX Sierra hosts file is ignored help?
– Andrew Morton
Mar 6 '18 at 18:50
add a comment |
4 Answers
4
active
oldest
votes
I had the hosts and IP addresses separated by tabs, switching to just one space between them worked for me:
127.0.0.1 www3.mytestsite.com
add a comment |
Works for me on a 10.13.3 system.
% grep example /etc/hosts
127.0.0.1 example.com
% perl -MSocket -e 'printf "%vxn", inet_aton "example.com"'
7f.0.0.1
% dns-sd -G v4 example.com
DATE: ---Tue 06 Mar 2018---
10:49:47.455 ...STARTING...
Timestamp A/R Flags if Hostname Address
TTL
10:49:47.457 Add 2 -1 example.com. 127.0.0.1
1
^C
However! Some applications (e.g. Google Chrome) may make their own queries to their own DNS servers (e.g. to 8.8.8.8
) or applications could easily ignore the /etc/hosts
file if they only make DNS requests and do not go through the system resolver.
% host example.com
example.com has address 93.184.216.34
example.com has IPv6 address 2606:2800:220:1:248:1893:25c8:1946
I added one more line:0.0.0.0 asdf.com
Nowhost asdf.com
printsasdf.com has address 64.90.40.65
anddns-sd -G v4 asdf.com
prints19:59:37.634 Add 2 -1 asdf.com. 0.0.0.0 1
Does this mean that my system completely ignores/etc/hosts
?
– dnnagy
Mar 6 '18 at 19:01
add a comment |
OSXDaily has a different command set for High Sierra - maybe worth a try...
sudo killall -HUP mDNSResponder; sleep 2; echo macOS DNS Cache Reset | say
or if it's being sticky...
sudo killall -HUP mDNSResponder && echo macOS DNS Cache Reset
add a comment |
I had this problem as well. It turns out I forgot to specify the port number my app was running on in the browser URL (e.g. www.mywebsite.com:1234).
New contributor
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1301006%2fetc-hosts-not-working-on-macos-10-13%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
I had the hosts and IP addresses separated by tabs, switching to just one space between them worked for me:
127.0.0.1 www3.mytestsite.com
add a comment |
I had the hosts and IP addresses separated by tabs, switching to just one space between them worked for me:
127.0.0.1 www3.mytestsite.com
add a comment |
I had the hosts and IP addresses separated by tabs, switching to just one space between them worked for me:
127.0.0.1 www3.mytestsite.com
I had the hosts and IP addresses separated by tabs, switching to just one space between them worked for me:
127.0.0.1 www3.mytestsite.com
answered Oct 6 '18 at 18:43
MrAn3MrAn3
1112
1112
add a comment |
add a comment |
Works for me on a 10.13.3 system.
% grep example /etc/hosts
127.0.0.1 example.com
% perl -MSocket -e 'printf "%vxn", inet_aton "example.com"'
7f.0.0.1
% dns-sd -G v4 example.com
DATE: ---Tue 06 Mar 2018---
10:49:47.455 ...STARTING...
Timestamp A/R Flags if Hostname Address
TTL
10:49:47.457 Add 2 -1 example.com. 127.0.0.1
1
^C
However! Some applications (e.g. Google Chrome) may make their own queries to their own DNS servers (e.g. to 8.8.8.8
) or applications could easily ignore the /etc/hosts
file if they only make DNS requests and do not go through the system resolver.
% host example.com
example.com has address 93.184.216.34
example.com has IPv6 address 2606:2800:220:1:248:1893:25c8:1946
I added one more line:0.0.0.0 asdf.com
Nowhost asdf.com
printsasdf.com has address 64.90.40.65
anddns-sd -G v4 asdf.com
prints19:59:37.634 Add 2 -1 asdf.com. 0.0.0.0 1
Does this mean that my system completely ignores/etc/hosts
?
– dnnagy
Mar 6 '18 at 19:01
add a comment |
Works for me on a 10.13.3 system.
% grep example /etc/hosts
127.0.0.1 example.com
% perl -MSocket -e 'printf "%vxn", inet_aton "example.com"'
7f.0.0.1
% dns-sd -G v4 example.com
DATE: ---Tue 06 Mar 2018---
10:49:47.455 ...STARTING...
Timestamp A/R Flags if Hostname Address
TTL
10:49:47.457 Add 2 -1 example.com. 127.0.0.1
1
^C
However! Some applications (e.g. Google Chrome) may make their own queries to their own DNS servers (e.g. to 8.8.8.8
) or applications could easily ignore the /etc/hosts
file if they only make DNS requests and do not go through the system resolver.
% host example.com
example.com has address 93.184.216.34
example.com has IPv6 address 2606:2800:220:1:248:1893:25c8:1946
I added one more line:0.0.0.0 asdf.com
Nowhost asdf.com
printsasdf.com has address 64.90.40.65
anddns-sd -G v4 asdf.com
prints19:59:37.634 Add 2 -1 asdf.com. 0.0.0.0 1
Does this mean that my system completely ignores/etc/hosts
?
– dnnagy
Mar 6 '18 at 19:01
add a comment |
Works for me on a 10.13.3 system.
% grep example /etc/hosts
127.0.0.1 example.com
% perl -MSocket -e 'printf "%vxn", inet_aton "example.com"'
7f.0.0.1
% dns-sd -G v4 example.com
DATE: ---Tue 06 Mar 2018---
10:49:47.455 ...STARTING...
Timestamp A/R Flags if Hostname Address
TTL
10:49:47.457 Add 2 -1 example.com. 127.0.0.1
1
^C
However! Some applications (e.g. Google Chrome) may make their own queries to their own DNS servers (e.g. to 8.8.8.8
) or applications could easily ignore the /etc/hosts
file if they only make DNS requests and do not go through the system resolver.
% host example.com
example.com has address 93.184.216.34
example.com has IPv6 address 2606:2800:220:1:248:1893:25c8:1946
Works for me on a 10.13.3 system.
% grep example /etc/hosts
127.0.0.1 example.com
% perl -MSocket -e 'printf "%vxn", inet_aton "example.com"'
7f.0.0.1
% dns-sd -G v4 example.com
DATE: ---Tue 06 Mar 2018---
10:49:47.455 ...STARTING...
Timestamp A/R Flags if Hostname Address
TTL
10:49:47.457 Add 2 -1 example.com. 127.0.0.1
1
^C
However! Some applications (e.g. Google Chrome) may make their own queries to their own DNS servers (e.g. to 8.8.8.8
) or applications could easily ignore the /etc/hosts
file if they only make DNS requests and do not go through the system resolver.
% host example.com
example.com has address 93.184.216.34
example.com has IPv6 address 2606:2800:220:1:248:1893:25c8:1946
answered Mar 6 '18 at 18:54
thrigthrig
63646
63646
I added one more line:0.0.0.0 asdf.com
Nowhost asdf.com
printsasdf.com has address 64.90.40.65
anddns-sd -G v4 asdf.com
prints19:59:37.634 Add 2 -1 asdf.com. 0.0.0.0 1
Does this mean that my system completely ignores/etc/hosts
?
– dnnagy
Mar 6 '18 at 19:01
add a comment |
I added one more line:0.0.0.0 asdf.com
Nowhost asdf.com
printsasdf.com has address 64.90.40.65
anddns-sd -G v4 asdf.com
prints19:59:37.634 Add 2 -1 asdf.com. 0.0.0.0 1
Does this mean that my system completely ignores/etc/hosts
?
– dnnagy
Mar 6 '18 at 19:01
I added one more line:
0.0.0.0 asdf.com
Now host asdf.com
prints asdf.com has address 64.90.40.65
and dns-sd -G v4 asdf.com
prints 19:59:37.634 Add 2 -1 asdf.com. 0.0.0.0 1
Does this mean that my system completely ignores /etc/hosts
?– dnnagy
Mar 6 '18 at 19:01
I added one more line:
0.0.0.0 asdf.com
Now host asdf.com
prints asdf.com has address 64.90.40.65
and dns-sd -G v4 asdf.com
prints 19:59:37.634 Add 2 -1 asdf.com. 0.0.0.0 1
Does this mean that my system completely ignores /etc/hosts
?– dnnagy
Mar 6 '18 at 19:01
add a comment |
OSXDaily has a different command set for High Sierra - maybe worth a try...
sudo killall -HUP mDNSResponder; sleep 2; echo macOS DNS Cache Reset | say
or if it's being sticky...
sudo killall -HUP mDNSResponder && echo macOS DNS Cache Reset
add a comment |
OSXDaily has a different command set for High Sierra - maybe worth a try...
sudo killall -HUP mDNSResponder; sleep 2; echo macOS DNS Cache Reset | say
or if it's being sticky...
sudo killall -HUP mDNSResponder && echo macOS DNS Cache Reset
add a comment |
OSXDaily has a different command set for High Sierra - maybe worth a try...
sudo killall -HUP mDNSResponder; sleep 2; echo macOS DNS Cache Reset | say
or if it's being sticky...
sudo killall -HUP mDNSResponder && echo macOS DNS Cache Reset
OSXDaily has a different command set for High Sierra - maybe worth a try...
sudo killall -HUP mDNSResponder; sleep 2; echo macOS DNS Cache Reset | say
or if it's being sticky...
sudo killall -HUP mDNSResponder && echo macOS DNS Cache Reset
answered Mar 6 '18 at 19:03
TetsujinTetsujin
15.8k53462
15.8k53462
add a comment |
add a comment |
I had this problem as well. It turns out I forgot to specify the port number my app was running on in the browser URL (e.g. www.mywebsite.com:1234).
New contributor
add a comment |
I had this problem as well. It turns out I forgot to specify the port number my app was running on in the browser URL (e.g. www.mywebsite.com:1234).
New contributor
add a comment |
I had this problem as well. It turns out I forgot to specify the port number my app was running on in the browser URL (e.g. www.mywebsite.com:1234).
New contributor
I had this problem as well. It turns out I forgot to specify the port number my app was running on in the browser URL (e.g. www.mywebsite.com:1234).
New contributor
edited 1 min ago
karel
9,28093239
9,28093239
New contributor
answered 12 mins ago
Shide FooShide Foo
1
1
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1301006%2fetc-hosts-not-working-on-macos-10-13%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Does OSX Sierra hosts file is ignored help?
– Andrew Morton
Mar 6 '18 at 18:50