View previous topic :: View next topic |
Author |
Message |
Raniz l33t
Joined: 13 Sep 2003 Posts: 967 Location: Varberg, Sweden
|
Posted: Wed Mar 09, 2011 8:07 am Post subject: [SOLVED] Switching between company and local DNS on VPN |
|
|
At work I've got a stationary computer that I use as a server, development is performed on a laptop which I take home at the end of the day.
I've set up a private VPN that works via an SSH tunnel (since our firewall won't let me connect to my stationary computer on any ports) and then uses NAT to allow me to connect to the rest of the computers in the network. It's not a pretty solution, but it does the trick.
My only problem right now is that I can't access my laptop via it's hostname when I'm connected to the VPN (our company's DNS picks it up via DHCP when I'm at work). Right now I have a definition of [laptop's hostname]0 in my /etc/hosts that I use when I'm connected via the VPN, but that adds a layer of inconvenience (changing/having duplicate scripts etc).
So, I'm looking for a way to use the company DNS when requesting the IP address for my laptop's hostname, but fallback to a static binding if the company's DNS can't resolve it (which means I'm connected to the VPN). I guess an alternate solution would be to run a script when my laptop connects to the VPN and then insert it into /etc/hosts, but I don't know how to do that either.
Any help is much appreciated!
Last edited by Raniz on Thu Mar 31, 2011 7:31 pm; edited 1 time in total |
|
Back to top |
|
|
Bones McCracker Veteran
Joined: 14 Mar 2006 Posts: 1611 Location: U.S.A.
|
Posted: Thu Mar 31, 2011 5:45 pm Post subject: |
|
|
I think you could use openresolv, provided that your vpn connection is identifiable as a logical network interface of some kind.
http://roy.marples.name/projects/openresolv _________________
patrix_neo wrote: | The human thought: I cannot win.
The ratbrain in me : I can only go forward and that's it. |
|
|
Back to top |
|
|
Raniz l33t
Joined: 13 Sep 2003 Posts: 967 Location: Varberg, Sweden
|
Posted: Thu Mar 31, 2011 7:32 pm Post subject: |
|
|
I solved it with a rather ugly trick involving a few scripts that edit /etc/hosts on the VPN server when I connect |
|
Back to top |
|
|
grimm26 Guru
Joined: 23 May 2004 Posts: 313 Location: Chicagoland, IL
|
Posted: Fri Apr 01, 2011 4:00 am Post subject: |
|
|
I'm interested in using openresolv, but I can't figure out how to set it up. The documentation for it is very spartan and there is no HOWTO. Any help? _________________ "Blessed is he who finds happiness in his own foolishness, for he will always be happy". |
|
Back to top |
|
|
Bones McCracker Veteran
Joined: 14 Mar 2006 Posts: 1611 Location: U.S.A.
|
Posted: Fri Apr 01, 2011 5:38 am Post subject: |
|
|
grimm26 wrote: |
I'm interested in using openresolv, but I can't figure out how to set it up. The documentation for it is very spartan and there is no HOWTO. Any help? |
Nope. If you can't figure it out, you don't get to use it. Just kidding.
Maybe you could visit the openresolv web site.
Or, you could start a thread in this forum by describing your problem (showing error messages, etc.), and asking a specific question. _________________
patrix_neo wrote: | The human thought: I cannot win.
The ratbrain in me : I can only go forward and that's it. |
|
|
Back to top |
|
|
|