Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

DNS Doctoring not working/ setup correctly

Posted on 2008-10-20
7
Medium Priority
?
1,420 Views
Last Modified: 2008-11-10
I thought I had DNS doctoring setup correctly but it deosnt appear to be working. Can someone forward me the CLI commands to setup DNS doctoring where a http and https requests the get resolved to 142.176.xxx.xxx gets reverted to an inside webserver at 192.168.113.15.

Attached is my current running config.

Thanks
Result of the command: "show running-config"
 
: Saved
:
ASA Version 8.0(3)6 
!
hostname ciscoasa
domain-name mydomain.ca
enable password rB1zdBSeYOLPaxEO encrypted
passwd 2KFQnbNIdI.2KYOU encrypted
names
name 192.168.113.15 PGWEB description Web Server
!
interface Vlan1
 nameif inside
 security-level 100
 ip address 192.168.113.2 255.255.255.0 
!
interface Vlan2
 nameif outside
 security-level 0
 ip address 142.176.xxx.xxx 255.255.255.240 
!
interface Ethernet0/0
 switchport access vlan 2
!
interface Ethernet0/1
!
interface Ethernet0/2
!
interface Ethernet0/3
!
interface Ethernet0/4
!
interface Ethernet0/5
!
interface Ethernet0/6
!
interface Ethernet0/7
!
ftp mode passive
clock timezone AST -4
clock summer-time ADT recurring
dns server-group DefaultDNS
 domain-name mydomain.ca
object-group protocol TCPUDP
 protocol-object udp
 protocol-object tcp
object-group network DM_INLINE_NETWORK_1
 network-object host tricon
 network-object host Phil
 network-object host Verb
object-group service DM_INLINE_TCP_1 tcp
 port-object eq ftp
 port-object eq ftp-data
access-list outside_1_cryptomap extended permit ip any Exchange 255.255.0.0 
access-list outside_access_in extended permit tcp any interface outside eq www 
access-list outside_access_in extended permit tcp any interface outside eq https 
access-list outside_access_in remark Remote Desktop connection to PGWEB
access-list outside_access_in extended permit tcp any interface outside eq 3389 
access-list outside_access_in remark SQL access
access-list outside_access_in extended permit tcp object-group DM_INLINE_NETWORK_1 interface outside eq 1433 
access-list outside_access_in remark PCAnywhere access to Interface Processor
access-list outside_access_in extended permit tcp any interface outside eq pcanywhere-data 
access-list outside_access_in remark PCAnywhere to Interface Processor
access-list outside_access_in extended permit tcp any interface outside eq 5632 
access-list outside_access_in remark Telecost VNC
access-list outside_access_in extended permit tcp any interface outside eq 5800 
access-list outside_access_in remark Maintenance VNC
access-list outside_access_in extended permit tcp any interface outside eq 5900 
access-list outside_access_in remark Remote V1 VNC
access-list outside_access_in extended permit tcp any interface outside eq 5901 
access-list outside_access_in remark Panasonic DVR access
access-list outside_access_in extended permit tcp any interface outside eq 87 
access-list outside_access_in remark Capture DVR access
access-list outside_access_in extended permit tcp any interface outside eq 88 
access-list outside_access_in extended permit tcp any interface outside object-group DM_INLINE_TCP_1 
access-list inside_nat0_outbound extended permit ip any Exchange 255.255.0.0 
pager lines 24
logging asdm informational
mtu inside 1500
mtu outside 1500
icmp unreachable rate-limit 1 burst-size 1
asdm image disk0:/asdm-602.bin
no asdm history enable
arp timeout 14400
global (outside) 1 interface
nat (inside) 0 access-list inside_nat0_outbound
nat (inside) 1 0.0.0.0 0.0.0.0
static (inside,outside) tcp interface www PGWEB www netmask 255.255.255.255  dns 
static (inside,outside) tcp interface https PGWEB https netmask 255.255.255.255  dns 
static (inside,outside) tcp interface 3389 PGWEB 3389 netmask 255.255.255.255 
static (inside,outside) udp interface www PGWEB www netmask 255.255.255.255  dns 
static (inside,outside) tcp interface 1433 PGServer1 1433 netmask 255.255.255.255 
static (inside,outside) tcp interface pcanywhere-data InterfaceProcessor pcanywhere-data netmask 255.255.255.255 
static (inside,outside) tcp interface 5632 InterfaceProcessor 5632 netmask 255.255.255.255 
static (inside,outside) tcp interface 5800 TelecostPC 5800 netmask 255.255.255.255 
static (inside,outside) tcp interface 5900 Honeywell 5900 netmask 255.255.255.255 
static (inside,outside) tcp interface 5901 RemoteV1 5901 netmask 255.255.255.255 
static (inside,outside) tcp interface 87 PanasonicDVR 87 netmask 255.255.255.255 
static (inside,outside) tcp interface 88 CaptureDVR 88 netmask 255.255.255.255 
static (inside,outside) tcp interface ftp PGWEB ftp netmask 255.255.255.255  dns 
static (inside,outside) tcp interface ftp-data PGWEB ftp-data netmask 255.255.255.255  dns 
access-group outside_access_in in interface outside
route outside 0.0.0.0 0.0.0.0 142.176.xxx.xxx 1
timeout xlate 3:00:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00
timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00
timeout sip-provisional-media 0:02:00 uauth 0:05:00 absolute
dynamic-access-policy-record DfltAccessPolicy
http server enable
http 192.168.113.0 255.255.255.0 inside
no snmp-server location
no snmp-server contact
snmp-server enable traps snmp authentication linkup linkdown coldstart
crypto ipsec transform-set ESP-AES-256-MD5 esp-aes-256 esp-md5-hmac 
crypto ipsec transform-set ESP-DES-SHA esp-des esp-sha-hmac 
crypto ipsec transform-set ESP-DES-MD5 esp-des esp-md5-hmac 
crypto ipsec transform-set ESP-AES-192-MD5 esp-aes-192 esp-md5-hmac 
crypto ipsec transform-set ESP-3DES-MD5 esp-3des esp-md5-hmac 
crypto ipsec transform-set ESP-AES-256-SHA esp-aes-256 esp-sha-hmac 
crypto ipsec transform-set ESP-AES-128-SHA esp-aes esp-sha-hmac 
crypto ipsec transform-set ESP-AES-192-SHA esp-aes-192 esp-sha-hmac 
crypto ipsec transform-set ESP-AES-128-MD5 esp-aes esp-md5-hmac 
crypto ipsec transform-set ESP-3DES-SHA esp-3des esp-sha-hmac 
crypto map outside_map 1 match address outside_1_cryptomap
crypto map outside_map 1 set peer 142.176.xxx.xxx 
crypto map outside_map 1 set transform-set ESP-3DES-SHA
crypto map outside_map interface outside
crypto isakmp enable outside
crypto isakmp policy 5
 authentication pre-share
 encryption 3des
 hash sha
 group 2
 lifetime 86400
crypto isakmp policy 10
 authentication pre-share
 encryption des
 hash sha
 group 2
 lifetime 86400
telnet timeout 5
ssh timeout 5
console timeout 0
dhcpd auto_config outside
!
dhcpd address 192.168.113.3-192.168.113.254 inside
dhcpd dns 142.177.1.2 142.177.129.11 interface inside
!
 
no threat-detection basic-threat
no threat-detection statistics access-list
tunnel-group 142.176.xxx.xxx type ipsec-l2l
tunnel-group 142.176.xxx.xxx ipsec-attributes
 pre-shared-key *
 isakmp keepalive disable
!
class-map inspection_default
 match default-inspection-traffic
!
!
policy-map type inspect dns preset_dns_map
 parameters
  message-length maximum 512
policy-map global_policy
 class inspection_default
  inspect dns preset_dns_map 
  inspect ftp 
  inspect h323 h225 
  inspect h323 ras 
  inspect rsh 
  inspect rtsp 
  inspect esmtp 
  inspect sqlnet 
  inspect skinny  
  inspect sunrpc 
  inspect xdmcp 
  inspect sip  
  inspect netbios 
  inspect tftp 
!
service-policy global_policy global
prompt hostname context 
Cryptochecksum:190f0130125423a69e34c17959d37c0a
: end

Open in new window

0
Comment
Question by:huntleyj
  • 4
  • 3
7 Comments
 
LVL 79

Expert Comment

by:lrmoore
ID: 22759471
The "dns" keyword at the end of the static lines is all you need.
The key is where is your dns server located? Are you using an internal DNS server for the internal clients?
If yes, then doctoring won't work anyway. The dns request must come from the client, pass through the firewall, then the response from an external dns server will be doctored before it is sent to the requesting pc.
0
 
LVL 3

Author Comment

by:huntleyj
ID: 22759531
This is what is wierd.
Yes the DNS server is local and the record on the server is pointing to the correct internal IP of the webserver. I have also manually input the record in the local machine(s) host file but for some unknown reason, at times both of these get ignored and a local PC will resolve the address to the external IP. I end up going around and doing a ipconfig /flushdns on the offending machines.
0
 
LVL 79

Expert Comment

by:lrmoore
ID: 22759605
so, both the public facing and the local domains are yourcompany.com?
Are you using DHCP or is everything static? Do clients have your local dns as primary and an external as secondary?
Agree that it is odd, because 1) the hosts file should be preferred, and 2) if they did go outside to a resolver, it should be doctored as it comes back in..
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 3

Author Comment

by:huntleyj
ID: 22759685
"so, both the public facing and the local domains are yourcompany.com?"  Yes. Should they be different?

"Are you using DHCP or is everything static?"  a bit of both. all servers are obviously static as well as a few workstations. Most workstations are DHCP though
"Do clients have your local dns as primary and an external as secondary?"  Yes. Right now I'm getting ready to test a machine with a static IP and external DNS servers only to see if DNS doctoring is working

 
0
 
LVL 3

Author Comment

by:huntleyj
ID: 22759792
Ok I just switched my machine over to a static IP with external DNS servers. Flushed the local dns, rebooted. then tried to go to www.mydomain.com. page couldnt be displayed. :(  
Tried to ping www.mydomain.com and it resolved to the external IP :(
To me it doesn't look like DNS doctoring is working at all. ARGH...  lol
0
 
LVL 79

Expert Comment

by:lrmoore
ID: 22761109
8.0.3(6) may be buggy. Try 8.0(4) ?
But.. with only internal DNS, it should always resolve to local IP, no?
0
 
LVL 79

Accepted Solution

by:
lrmoore earned 2000 total points
ID: 22761234
References
http://www.cisco.com/en/US/products/ps6120/products_configuration_example09186a00807968d1.shtml

You may need to enable dns inspect

Else look at the secondary solution for hairpining with a stat (inside,inside) command

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For months I had no idea how to 'discover' the IP address of the other end of a link (without asking someone who knows), and it drove me batty. Think about it. You can't use Cisco Discovery Protocol (CDP) because it's not implemented on the ASAs.…
Considering cloud tradeoffs and determining the right mix for your organization.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…
Both in life and business – not all partnerships are created equal. Spend 30 short minutes with us to learn:   • Key questions to ask when considering a partnership to accelerate your business into the cloud • Pitfalls and mistakes other partners…
Suggested Courses

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question