cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
561
Views
1
Helpful
4
Replies

DNS flush - Anyconnect VPN

21CEL
Level 1
Level 1

Hello,

 

Is it possible to automatically flush DNS before establshing vpn connection?

Instead of manually use commands such as

ipconfig /flushdns

ipconfig /release

ipconfig /renew


1 Accepted Solution

Accepted Solutions

j.a.m.e.s
Level 3
Level 3

@21CEL I also don't see why you would want to flush DNS prior to establishing the VPN, but you could potentially do it after establishing the VPN with an OnConnect.bat script.

You need something like this in your XML:

<EnableScripting UserControllable="false">true</EnableScripting>

Then upload your script to disk0: on the ASA and load it: 

! Activate OnConnect script:

import webvpn AnyConnect-customization type binary platform win name scripts_OnConnect.bat disk0:/OnConnect.bat

! Check it:

show import webvpn AnyConnect-customization detailed

! Remove OnConnect script:

revert webvpn AnyConnect-customization type binary platform win name scripts_OnConnect.bat

 

View solution in original post

4 Replies 4

I'm not aware of anyway to do it, but why would you want to do that?

I worked for a few companies and we had problems always with DNS. 

Couldn't ping the machine and need to find real ip.

The only way to fix this annoying issue was asking our users to flush the dns via cmd and then connect to vpn

Imagine how hard is this when end user has no IT knowledge and I need to explain how to do it. 

 

So there is absolutely no way to do it?

Or

At least some troubleshooting option in Cisco to do it all in easy way?

What kind of DNS issues?

j.a.m.e.s
Level 3
Level 3

@21CEL I also don't see why you would want to flush DNS prior to establishing the VPN, but you could potentially do it after establishing the VPN with an OnConnect.bat script.

You need something like this in your XML:

<EnableScripting UserControllable="false">true</EnableScripting>

Then upload your script to disk0: on the ASA and load it: 

! Activate OnConnect script:

import webvpn AnyConnect-customization type binary platform win name scripts_OnConnect.bat disk0:/OnConnect.bat

! Check it:

show import webvpn AnyConnect-customization detailed

! Remove OnConnect script:

revert webvpn AnyConnect-customization type binary platform win name scripts_OnConnect.bat