You've got a domain setup in DNS (using Freesco) to resolve to a machine on your LAN, as explained here. Now, you can visit your website from the local network, but you want to be able to lookup a machine's name based on its IP address.

Login as root, edit the file named above, and add one entry per subdomain in the format:

y.x<TAB>IN<TAB>PTR<TAB>subdomain.DOMAIN.<TAB>

A couple of notes: y.x refers to the last two octets of your IP address in reverse order (eg: for 192.168.42.76, you'd use 76.42). subdomain is your subdomain, and .DOMAIN. is literal text - don't alter it.

NOTE: You need to replace named192.rev above with the appropriate filename, as explained in the table at the top of this page.

Now, you need to enter any subdomains that you want to setup. For our example, we wanted 192.168.0.1 to resolve to router.example.com, 192.168.0.10 to resolve to www.example.com, and 192.168.0.15 to resolve to mail.example.com, so we entered:

This is a bit tricky. The first item on each line is the LAST TWO octets of your IP address, in reverse order (eg: if your address was 192.168.47.92, you'd use 92.47). If you're using 10.x.x.x addresses, it's the last THREE octets in reverse order.

IN and PTR have special meaning - don't change or omit them. Next is the subdomain you want to setup, followed by a period, followed by the word DOMAIN, followed by another period. Don't forget the final <TAB> at the end of each line.

And note that where we say <TAB>, we mean that you should press the TAB key. The FREESCO editor shows TAB characters as a bold capital *I*

Next, press Alt+X to exit, and when the editor asks you to save, press Y to confirm.

Finally, you should restart your nameserver. Type:

cp /mnt/router/etc/named*.rev /etc
rc_named restart

At this point, you should be able to type nslookup www.example.com on one of your Windows boxes (or host www.example.com under Linux), and it should return the correct IP address for that domain.

Note that your default domain (or “primary DNS suffix”) on all of the machines on your network should be example.com, as well. On Windows XP, for example, you can change your primary DNS suffix under Start|Control Panel|System|Computer Name|Change|More….