Use hostname to reach OpenVPN clients
-
@Unoptanio I haven't encountered any problems related to that but I also wasn't aware that it could be a problem.
I was not aware that the VPN registering clients in DHCP would cause unbound (DNS Resolver) to restart, also not sure if that is really the case or not.If you want to test you try to enable the register in DHCP feature, connect a client and then check Status -> System Logs -> System -> DNS Resolver and look for "start of service (unbound)" or "service stopped (unbound)" and see if that coincides with the time the VPN client connected. If not, then unbound does not restart when VPN register clients in DHCP.
-
-
@Unoptanio Go to Services -> DNS Resolver and enable this:
Then you can resolve the hostnames of all clients connected via VPN, no matter what interface you're coming from - as long as the device use the pfSense as DNS which is the case by default.
-
ok found it. I already had the setting active
i have check Status -> System Logs -> System -> DNS Resolver
but i have only this data:
-
@Unoptanio I'm not sure if you will see anything in that log (maybe, maybe not). Just try to connect a client to OpenVPN and then from the pfSense try nslookup <hostname> which in this case would be the Common Name of that particular client, or maybe the Username if you use User Auth. It should provide you with the IP of that particular client and if it does, it works. Hope that makes sense, else just ask.
-
-
@Unoptanio Does that happen when a client connects?
-
I tried to make some openvpn connections now and to connect in rdp using the name.domain format but nothing appears in the log section relating to today's date, September 16th.
in the log the first occurrence of "start of service (unbound)" is on September 14th but I don't know what it referred toof today 16th September I only have the first line in the log
do you have different data in your firewall?
-
@Unoptanio Don't worry about the log at first, just check if things work or not. Start by checking from the pfSense itself using Diagnostics -> DNS Lookup and see if you can get an IP for your connected client.
-
-
@Unoptanio As long as you have manually added Host Overrides then you'll never find out if "Register connected OpenVPN clients in the DNS Resolver" is working because the Host Overrides will take priority. If you list something in Host Overrides it will ALWAYS work in the sense that the DNS Resolver will return an IP for anything listed in the Host Overrides no matter if it exists or not.
But is it otherwise working as it should?
-
At the moment, with the current configuration, everything works for me.
Before compiling this DNS override table, RDP access using the name.domain format did not work for me.
RDP access only worked using the machine's IP address
RDP access using name.domain format should theoretically work even without having filled in the DNS resolver override table? yes o no?
-
@Unoptanio That's great!
-
-
@Unoptanio Is what without using Host Overrides?
-
@zapador
it was only a question.Initially I thought that once connected to openvpn, the names of the machines that are on the 192.168.1.x network would automatically be visible without use dns override
-
@Unoptanio said in Use hostname to reach OpenVPN clients:
Initially I thought that once connected to openvpn, the names of the machines that are on the 192.168.1.x network would automatically be visible without use dns override
If you use "Register connected OpenVPN clients in the DNS Resolver" it should work without adding any Host Override. If not something is misconfigured or you're trying with an incorrect hostname, something along those lines.
-
the host I need to reach using the name is in the remote office network which has ip 192.168.1.x.
From my home PC I connect to OPEN VPN and by checking as you said the name is correctly registered: usernameopenvpn.domain and the IP address returns 10.10.94.x
-
@Unoptanio Ah alright. Not sure exactly why that is, seems a bit odd. Is this an acceptable solution though, manually creating the Host Override entries?
-
could it be a bug in the pfsense 2.7.0 version?
For now I'll leave it alone that it works.
I'll tell you this last thing:
on the office network 192.168.1.x I have a machine called "Server5k".
If I go to pfsense--> diasgnostics--> DNS lookup it doesn't resolve the name
does not find any machine names on the 192.168.1.x network