我正在尝试在我的networking上设置一个托pipe在我的networking上的人可以通过http://custom.local/
我可以在Mac上访问它,因为我已经在/etc/hosts设置了Apache VirtualHost
127.0.0.1 custom.local
我运行$ named-checkconf /etc/named.conf ,它没有返回任何东西,
我运行了$ named-checkzone custom.local /var/named/custom.local.zone
其中返回
zone hercules.local/IN: loaded serial 2012032301 OK
但networking上的其他人仍然无法访问域。
我有/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
并在/etc/named.conf
zone "custom.local" IN { type master; file "custom.local.zone"; };
当我运行$ rndc reload和$ rndc flush时也是如此
WARNING: key file (/private/etc/rndc.key) exists, but using default configuration file (/private/etc/rndc.conf) server reload successful
我错过了什么?
您尝试从运行OS X或其他操作系统连接的其他计算机? 如果是其他操作系统,则需要将其configuration为使用Mac作为其DNS服务器(否则,custom.local的查找将永远不会发送到计算机上的BIND)。
如果你试图从其他OS X电脑上访问它,情况会有所不同,因为OS X使用多播DNSparsing* .local而不是标准的DNS查找。 为了达到这个效果,请转到(服务器)Mac上的“系统偏好设置”,打开“共享”窗格,然后单击顶部附近的“编辑”button,将Mac的mDNS名称更改为custom.local。
127.0.0.1是回送地址,这是专门用于引用自己的机器。
networking上的任何其他机器将无法将127.0.0.1parsing到您的机器,因为它已经指向自己的机器!
您需要将IP更改为networking中您计算机的外部IP地址(例如192.168.1.5)。
另外,要生成一个rndc键使用:
sudo rndc-confgen -a