DNS – How to Set Public Hostname

domain-name-system

I have 100/100 mbit link with static public ip configured on interface on Cisco router. On lan side I have domain controller with dns server and computers.

How can I make that computers go outside as domain.com instead of ip address / how to set hostname to domain name.

For example: when I visit serverfault.com I want that my visit is logged as domain.com not visit from xxx.xxx.xxx.xxx

Best Answer

In order to be seen as a DNS name instead of IP address (if the system logging your connection is doing reverse lookups) you need a Pointer record PTR that maps your IP to a hostname (also called reverse DNS).

It depends on your ISP and your internet connection contract whether you are allowed to request for PTR record changes for your public IP, as the PTR records are managed by the registered owner of the IP block. You can do a lookup on ARIN WHOIS IP Address Database to see the actual owner.

If your ISP allows you to request for a custom reverse name (instead of their own or blank), you also need corresponding A record in the DNS of your domain, i.e.

example.com.                8850 IN     A       93.184.216.34
34.216.184.93.in-addr.arpa. 3600 IN     PTR     example.com.

Having both PTR and A mapped is probably not necessary unless you are maintaining an own mail (SMTP) server: the only reasonable requirement for working reverse DNS is that reverse DNS should match SMTP banner (the name that your SMTP server uses for introducing itself):

Some receiving mail servers may use this as an indication of a possible spam source in a scoring system. Most will not reject incoming mail solely on this basis. We recommend that you contact your ISP and ask them to setup a reverse record (PTR) that matches the hostname of your mail server.

Even in this case a suitable workaround is to change the SMTP banner to match the reverse DNS: you always have control on your SMTP banner even when you can't control the PTR record.

The logs on remote server are not good for advertisement as only technical persons ever sees them. Conversely, having your company domain pointing at your on-premises instead of a public server and exhibiting that this is the public IP of your office may lure some denial of service attempts. Therefore most organizations would want to avoid having custom PTR records.