02-08-2024 08:28 AM
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
Solved! Go to Solution.
02-11-2024 08:48 AM
@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
02-08-2024 09:01 AM
I'm not aware of anyway to do it, but why would you want to do that?
02-08-2024 02:12 PM
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?
02-12-2024 07:00 AM
What kind of DNS issues?
02-11-2024 08:48 AM
@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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide