Configuring Cisco VPN for local DNS connections on Leopard

1/ Connect CISCO VPN client - it will overwrite DNS settings in /etc/resolv.conf with whatever is read from the network the VPN is connecting to.

If you're unlucky at this point normal DNS queries will no longer work.


2/ Use scutil to add a local DNS server:



diciu$ sudo scutil
> get State:/Network/Service/com.cisco.VPN/DNS

> d.show
{
ServerAddresses : {
0 : 10.10.10.1
1 : 10.10.10.2
}
DomainName : somedomain.com
SearchDomains : {
0 : somedomain.com
1 : modulo.ro
}
}
> d.add ServerAddresses * 193.231.199.1
> set State:/Network/Service/com.cisco.VPN/DNS
> d.show
{
ServerAddresses : {
0 : 193.231.199.1
}
DomainName : somedomain.com
SearchDomains : {
0 : somedomain.com
1 : modulo.ro
}
}


Single line command:


printf "get State:/Network/Service/com.cisco.VPN/DNS\nd.add ServerAddresses * 193.231.199.1\nset State:/Network/Service/com.cisco.VPN/DNS" | sudo scutil


References: Using scutil to set DNS server