Resolution
This feature is implemented in Cisco IOS Software Release 12.4(2) onwards. Once Cisco IOS is upgraded to anything later than 12.4(2)T, you can do this configuration:
#configure terminal
(config)#voice service voip
(conf-voip-serv)#sip
(conf-serv-sip)#[no | default] localhost dns:
Example:
(conf-serv-sip)#localhost dns:name1.com
In order to disable the usage of DNS name under specific dial-peers, you can configure the dial-peer with:
#configure terminal
(config) dial-peer voice 100 voip
(config-dial-peer)#[no | default] voice-class sip localhost
[dns]:
In the CLI, there is a provision to exclude a specific dialpeer from the use of the global configuration under voice service voip. In order to do that, use the no version command under dialpeer. This change has been made to allow for the case when the global localhost command is configured and most but not all the dialpeers want to use that config. For the dialpeers that want to fallback to the use of the IP address in the From, Call-ID & RPID headers, this command can be useful.The default version of the command causes the dial-peer to use the globally configured CLI under voice service voip, SIP.
Example:
dial-peer voice 6 voip
no voice-class sip localhost
Refer to Cisco IOS SIP Configuration Guide for more information.