How to include the own zone file in /etc/com.apple.named.proxy.conf

dnsinternet-sharing

When I enable internet connection sharing, a local named DNS nameserver is started that uses the file /etc/com.apple.named.proxy.conf for configuration.

My internet connection sharing is configured such that my Mac gets address 192.168.2.1

On my Mac, I have a local web server with several development vhosts. I would like to make their names known to devices that connect through the shared internet connection. I try this by including this section into com.apple.named.proxy.conf:

zone "local" IN {
    type master;
    file "vhosts.zone";
    allow-update { none; };
};

My problem is that the file /etc/com.apple.named.proxy.conf gets recreated on every new sharing session and any modifications I make to this file are lost.

Is there a source or template file from which com.apple.named.proxy.conf is created?

Best Answer

You need to add to the file /etc/hosts - this is read by the DNS server before it goes to any other source.

You will need to add a line

192.168.2.1   machine alias1 alias2 alias3

Obviously replace "machine" and the other items with the correct values.