1

I'm trying to set up a web app hosted on my mac in which people on my network can access via http://custom.local/

I can access it on the mac since I have set up an Apache VirtualHost and in /etc/hosts

127.0.0.1       custom.local

I ran $ named-checkconf /etc/named.conf which didn't return anything,

I ran $ named-checkzone custom.local /var/named/custom.local.zone on

which returned

zone hercules.local/IN: loaded serial 2012032301
OK

but others on the network still can't access the domain.

I have in /var/named/custom.local.zone

;BIND db file for custom.local

$ORIGIN custom.local.
$TTL 86400

@       IN      SOA     custom.local. root.custom.local.    (
                        2012032301      ; serial number as yymmddnn
                        15      ; refresh
                        3600    ; retry
                        3000000 ; expire
                        86400   ; min ttl
        )

        NS      custom.local.
custom.local. IN      A       127.0.0.1

and in /etc/named.conf

zone "custom.local" IN {
        type master;
        file "custom.local.zone";
};

also when I run $ rndc reload and $ rndc flush I get

WARNING: key file (/private/etc/rndc.key) exists, but using default configuration file (/private/etc/rndc.conf)
server reload successful

What am I missing?

Adam-E
  • 147
  • 1
  • 9

2 Answers2

1

Are the other computers you're trying to connect from running OS X, or some other operating system? If it's some other OS, you need to configure them to use your Mac as their DNS server (otherwise the lookups for custom.local never get sent to BIND on your computer).

If you're trying to reach it from other OS X computers, things are a bit different because OS X resolves *.local using multicast DNS rather than a standard DNS lookup. To get this working, go to System Preferences on your (server) Mac, open the Sharing pane, and click the Edit button near the top to change your Mac's mDNS name to custom.local.

Gordon Davisson
  • 11,036
  • 3
  • 27
  • 33
  • 2
    Gordon is correct. OSX and most modern Linux distros use mDNS to look up .local TLD names. In general making up a TLD like .local is not a good idea. For instance there's nothing saying that ICANN can't sell or create a .local TLD. – 3dinfluence Mar 23 '12 at 18:46
  • I must confess that I am not entirely informed on how DNSes work. I should note that other users can already access my webroot, in my case, creative.local using the method you suggested. Perhaps it's possible to have a subdomain instead? – Adam-E Mar 23 '12 at 21:41
  • @Adam: I'll need more information to make useful suggestions. What OSes are you trying to connect to the server from? What's your network setup like (e.g. is it a single LAN with no other servers, or is there a more complex setup)? Also, you mention that some other users can access the webroot; what's different between the ones that can and those that can't? – Gordon Davisson Mar 24 '12 at 03:49
0

127.0.0.1 is the loopback address, this is specifically for a machine to refer to itself.

Any other machine on the network will not be able to resolve 127.0.0.1 to your machine because it already points to their own machine!

You need to change the IP to be your machine's external IP address on your network (e.g. 192.168.1.5).

Also, to generate an rndc key use:

sudo rndc-confgen -a
SJT
  • 101