OpenVPN not working with /etc/hosts

Hello,

I am no expert in networking but I setup OpenVPN and thought when I connect with a client, this client would be using the server /etc/hosts file to resolve addresses.

What I want to do is point to an IP with a hostname simply, and figured I should not use bind DNS server for such a simple thing.

But, while pinging from the server (connected via ssh) resolves the host and its subdomains correctly, and using lynx also via ssh shows the correct sites, doing so via VPN doesn't resolve the address.

I checked /etc/host.conf and it has the correct order, or so I think: hosts,bind. I don't know what is going on and would like some guidance if possible.

Thank you.

EDIT: Better explanation of what I am trying to do:

I have a DNS server configured at home, which will take say

mvn.loc and redirect to an nginx application.

app1.mvn.loc to another

app2.mvn.loc to another

When I am using a computer I could just edit my /etc/hosts file and setup the ips as:

mvn.loc 80.123.123.123

app1.mvn.loc 80.123.123.123

app2.mvn.loc 80.123.123.123

So when I input mvn.loc into the browser I get the correct site.

Or either setup the dns server in my router/pc instead of using a hosts file which would resolve the hostnames the same way.

What I want to do is to access this sites from my phone, where I cannot edit /etc/hosts and cannot setup my home address as a DNS server while using 3G. I figured I could use my newly configured Linode VPN so when I connect, the /etc/hosts file in my linode would be the one resolving the addresses.

I don't know if this is clearer somehow. Sorry about that, and thanks for your interest.

2 Replies

You'll need to explain a lot clearer what you're trying to do and why?

@mvn:

I figured I could use my newly configured Linode VPN so when I connect, the /etc/hosts file in my linode would be the one resolving the addresses.
OpenVPN by itself won't do anything about name resolution - you need to set up a nameserver on the linode if you want this to work the way you describe.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct