New Member
Posts: 5
Registered: ‎06-25-2014

Re: Name resolution across OpenVPN

Sorvani,

Sorry to report but this did not work:

ubnt@ubnt:# set system static-host-mapping host-name myserver inet 10.10.10.10

 The router accepted the command, I followed it up with commit, save, exit. However, when I try to ping "myserver" I still get the same non-resolution. Is there some way to verify this?

 

Regular Member
Posts: 745
Registered: ‎11-06-2013
Kudos: 230
Solutions: 26

Re: Name resolution across OpenVPN

DNS information is cached. have you flushed all the DNS caches or rebooted everything?

Established Member
Posts: 1,043
Registered: ‎02-17-2014
Kudos: 386
Solutions: 40

Re: Name resolution across OpenVPN

[ Edited ]

Did you try setting the remote router as a secondary dns-server?

set system name-server <lan address of remote router>
set service dns forwarding listen-on vtun0

 This needs to be done on both routers for reciprical operation.  Or.....

set system name-server <lan address of remote router>

 On local router and

set service dns forwarding listen-on vtun0

 on remote router where servers are located, for oneway service.

Regular Member
Posts: 745
Registered: ‎11-06-2013
Kudos: 230
Solutions: 26

Re: Name resolution across OpenVPN

I tested the static host name mapping locally. the ERL obviously can ping by name, but my desktop cannot find it.

I swear this worked before but maybe it doesn't. Rebooted the ERL and then my desktop did an "ipconfig /flushdns" and my desktop ONLY has the ERL for a DNS server. nothing. I will have to work on testing this more because I need this base functionality (rarely obviously or I would have caught it by now).

Highlighted
Regular Member
Posts: 745
Registered: ‎11-06-2013
Kudos: 230
Solutions: 26

Re: Name resolution across OpenVPN

Ah ha! Found it. The single hostname fails. but a two part name or a fully qualified hostname works.

set system static-host-mapping host-name somepc inet 10.1.1.2
set system static-host-mapping host-name somepc.somedomain inet 10.1.1.2
set system static-host-mapping host-name somepc.somedomain.local inet 10.1.1.2

 I set this up in my ERL. the network 10.1.1.0/24 is across vtun7 

here are the results.

C:\>ping somepc.somedomain.local

Pinging somepc.somedomain.local [10.1.1.2] with 32 bytes of data&colon;
Reply from 10.1.1.2: bytes=32 time=42ms TTL=126
Reply from 10.1.1.2: bytes=32 time=22ms TTL=126
Reply from 10.1.1.2: bytes=32 time=23ms TTL=126
Reply from 10.1.1.2: bytes=32 time=22ms TTL=126

Ping statistics for 10.1.1.2:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 22ms, Maximum = 42ms, Average = 27ms

C:\>ping somepc.somedomain

Pinging somepc.somedomain [10.1.1.2] with 32 bytes of data&colon;
Reply from 10.1.1.2: bytes=32 time=24ms TTL=126
Reply from 10.1.1.2: bytes=32 time=23ms TTL=126
Reply from 10.1.1.2: bytes=32 time=22ms TTL=126
Reply from 10.1.1.2: bytes=32 time=25ms TTL=126

Ping statistics for 10.1.1.2:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 22ms, Maximum = 25ms, Average = 23ms

C:\>ping somepc
Ping request could not find host somepc. Please check the name and try again.