sorry for being noob here, but I've been googling for so long and found so many different solutions and guides about this problem, that it completely does my head in and just confuses me instead of helping
I have an "allrounder" standalone server at the office, running many many services by itself (emails/postfix/imap, webserver, samba (with AD), ftp, ssh, etc.) - and now OpenVPN. OS is Ubuntu 18.04. It is behind an old cheap router, in a subnet with the office computers it serves.
The entire "ecosystem" relies on the server's name (hostname and netbios name are the same): windows clients attach samba shares via "\\servername\sharename" URLs, many files are linked to in excel tables that way, scripts use that, email clients acces the local imap server as "servername:143", and send emails through local postfix which is again referred to by the servername. Etc.
Now, when I connect to the server with a windows client using the OpenVPN GUI, the connection works, but there's no name resolution at all. (I'm using dnsmasq on the server itself). Internet does not work over the VPN either but that is actually right so.
I can access samba and its shares through "\\10.8.0.1\", and send emails through postfix if I use the 10.8.0.1 IP instead of the server name, etc.
My goal is: the server should be referred to or accessed by the same hostname, regardless of wheter the user is in the office and connects to the network locally, or is at home and connects to the server via oVPN, seamlessly, without having to reconfigure anything.
So I guess a simple client side hostfile hack is not possible.
I'm really not sure about the whole routing and ip forwarding and so on. I tied them but probably wrong. I'm also reading something about this being a resolved bug on ubuntu 18.?
Any kind help is appreciated.
key servername.key # This file should be kept secret
server 10.8.0.0 255.255.255.0
push "dhcp-option DNS 192.168.2.10"
keepalive 10 120
tls-auth ta.key 0 # This file is secret
remote dyndns.host.na.me 2194
-----BEGIN PRIVATE KEY-----
-----END PRIVATE KEY-----
-----BEGIN OpenVPN Static key V1-----
-----END OpenVPN Static key V1-----