Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Switching between company and local DNS on VPN
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Raniz
l33t
l33t


Joined: 13 Sep 2003
Posts: 967
Location: Varberg, Sweden

PostPosted: Wed Mar 09, 2011 8:07 am    Post subject: [SOLVED] Switching between company and local DNS on VPN Reply with quote

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
View user's profile Send private message
Bones McCracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1611
Location: U.S.A.

PostPosted: Thu Mar 31, 2011 5:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
Raniz
l33t
l33t


Joined: 13 Sep 2003
Posts: 967
Location: Varberg, Sweden

PostPosted: Thu Mar 31, 2011 7:32 pm    Post subject: Reply with quote

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
View user's profile Send private message
grimm26
Guru
Guru


Joined: 23 May 2004
Posts: 313
Location: Chicagoland, IL

PostPosted: Fri Apr 01, 2011 4:00 am    Post subject: Reply with quote

BoneKracker wrote:
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

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
View user's profile Send private message
Bones McCracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1611
Location: U.S.A.

PostPosted: Fri Apr 01, 2011 5:38 am    Post subject: Reply with quote

grimm26 wrote:
BoneKracker wrote:
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

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. :P

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum