2

I've had two sites on my local host and have had mysite1.local and mysite2.local in my /etc/hosts file to pointing in my localhost. Now, I moved those sites into my homeserver (Ubuntu, Local network) and made changes to the hosts file, and also in /private/etc/hosts is the same. The files have 644 permissions.

192.168.0.50 mysite1.local
192.168.0.50 mysite2.local

I flushed my dnscache

sudo dscacheutil -flushcache

I rebooted the machine, reset Safari but still no changes.. Still if I try to go either mysite1.local or mysite2.local, it is pointing to localhost!

When I run

dscacheutil -q host -a name mysite1.local

It returns name: mysite1.local ip_address: 127.0.0.1 two times and if I do the same for mysite2.local, it returns name: mysite2.local ip_address: 127.0.0.1 only once.

What could be the problem?

OS is Snow Leopard 10.6.8

4
  • Yes, hosts file is where I made hosts changes! /etc/hosts file permissions are 644. When I ran your command mysite1.local puts name: mysite1.local ip_address: 127.0.0.1 two times and mysite2.local puts name: mysite2.local ip_address: 127.0.0.1 one time.. weird!? Without .local I get nothing??
    – Marko
    Nov 26, 2011 at 10:44
  • No... ? Why you ask? Never heard that command before!?
    – Marko
    Nov 26, 2011 at 11:21
  • That would have been another way to set those redirects. I updated your question to include what we know so far — I'll delete my comments. For now, I'm a bit out of ideas.
    – slhck
    Nov 26, 2011 at 11:31
  • Okey, thank you sir! :) I could and at the moment are using different local domain to get access to mysites. So new records works just fine not just those what I was using to point localhost... COuld there be some other hosts file/s what system will use?
    – Marko
    Nov 26, 2011 at 17:54

1 Answer 1

0

A great deep-dive into DNS in Snow Leo is here

My best guess is that you have a cached .local domain flat file in /etc/resolver that wasn't refreshed/flushed properly. By the way, are you using the system's apache? Where did you make the local virtual host changes, to point to the corresponding site files? .local is always a troublesome domain to use, as it overlaps with the Bonjour protocol's default/expected namespace, and (as described in the article above,) all resolution goes through the same daemon.

You must log in to answer this question.

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