0

Just added a record in my /etc/hosts but it doesn't work. I also tried to clear DNS via this way:

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

When I ping that IP, it's still the IP in the real-world.

What can I do with this (so that the domain will go to the IP in my hosts file.

2

1 Answer 1

0

I had the same issue.

sudo /etc/hosts (added "1.1.1.1 www.mytest222.com")
cat /etc/hosts (the above line was there)

host www.mytest222.com
#not found

nslookup www.mytest222.com
#not found

ping www.mytest222.com --> it worked and solved the IP 1.1.1.1

dscacheutil -q host -a name www.mytest222.com --> it worked too

The Chrome browser also resolved 1.1.1.1

I really don't know why host and nslookup didn't work.

1

You must log in to answer this question.

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