What's new

Adding DNS entries for local machines

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

sunactive

Occasional Visitor
I apologize if this has been answered elsewhere, I could not find a thread. I have two Asus routers set up with a bidirectional VPN (OpenVPN) and can access machines on both remote nets which is great.

However, I would also like to assign alpha friendly names for each of the machines so rather than accessing them by their IP addresses both locally and remotely, I can just use through DNS resolution a name for the machine. I appear to be able to set this up on each individual asus router for their local machines by modifying DCHP entries to allow for manual assignment for such local machines and adding a "hostname". However, probably a bit of a kludge.

Issue is I can't do that to set names for the remote machines from each sub-net. What I would need is a DNS server running where I could add entries, but not sure how I go about that. Frankly what I'd love to do is have either one of my routers or the other run a local DNS server and then add entries there, and simply point the two routers to that DNS server so they consistently pick up all the local names.

Anyway, any thoughts here? To be honest if there is a really simple way, would love to just use the web interface in Merlin to add entries and be done with it. But just doesn't appear to be possible.
 
The simplest way would be to use a TAP connection instead of TUN. I wouldn't normally recommend such a setup as it means the client-side network is dependent upon it always having a working connection to the server side. As such I regard it as "brittle", but depending on your circumstances it might be appropriate.
 
I apologize if this has been answered elsewhere, I could not find a thread. I have two Asus routers set up with a bidirectional VPN (OpenVPN) and can access machines on both remote nets which is great.

However, I would also like to assign alpha friendly names for each of the machines so rather than accessing them by their IP addresses both locally and remotely, I can just use through DNS resolution a name for the machine. I appear to be able to set this up on each individual asus router for their local machines by modifying DCHP entries to allow for manual assignment for such local machines and adding a "hostname". However, probably a bit of a kludge.

Issue is I can't do that to set names for the remote machines from each sub-net. What I would need is a DNS server running where I could add entries, but not sure how I go about that. Frankly what I'd love to do is have either one of my routers or the other run a local DNS server and then add entries there, and simply point the two routers to that DNS server so they consistently pick up all the local names.

Anyway, any thoughts here? To be honest if there is a really simple way, would love to just use the web interface in Merlin to add entries and be done with it. But just doesn't appear to be possible.

Does all traffic go across the VPN or only certain traffic?

I'm assuming it is only certain traffic, in which case below are a couple options:

1. Use dnsmasq.postconf script to add the remote hostnames into the local DNS. I would also add cnames or A records for "host.domain" in case the lookup appends the domain. Optionally you can add PTR records but those aren't critical. This works if it isn't a large amount of devices and they aren't changing frequently. You would do this on both routers for the remote devices. You could disable DNS on one router and have it point to the other for DNS (so that you only need to do the script on one of them, since the other will already know its local entries), but then all your local internet DNS lookups would need to use the VPN to hit the other router for their lookups, not really ideal. Or if you only care about it on the "non-home" router you can leave DNS enabled on both routers and only do the script on the non-home router to get back to the "home" hostnames. That way your non-home router does all your lookups at the non-home site, including the IPs of the home devices, and the home router acts as normal, it doesn't know about hostnames for the non-home devices, only its own LAN and internet.

2. Put the routers into two different domains (LAN1 and LAN2 for example, or home1.net and home2.net). On each router use the dnsmasq.postconf script to add a forwarder to tell it to forward lookups for the remote domain to the remote router's IPs. Again you could do this on both routers or just one depending what you need. Then everything after that is done in the GUI, hosts that report their hostname will already be in DNS and their IPs will update automatically, and ones you want to customize you use DHCP reservations for and set the hostname there. Disadvantage here is you will need to specify the domain on your lookups, at least for the remote IPs, shouldn't be a huge deal though.
 
Last edited:
The simplest way would be to use a TAP connection instead of TUN. I wouldn't normally recommend such a setup as it means the client-side network is dependent upon it always having a working connection to the server side. As such I regard it as "brittle", but depending on your circumstances it might be appropriate.
Unfortunately I think if I swap to TAP from TUN, that will screw up some other things of mine within the two networks.
 
Does all traffic go across the VPN or only certain traffic?

I'm assuming it is only certain traffic, in which case below are a couple options:

1. Use dnsmasq.postconf script to add the remote hostnames into the local DNS. I would also add cnames or A records for "host.domain" in case the lookup appends the domain. Optionally you can add PTR records but those aren't critical. This works if it isn't a large amount of devices and they aren't changing frequently. You would do this on both routers for the remote devices. You could disable DNS on one router and have it point to the other for DNS (so that you only need to do the script on one of them, since the other will already know its local entries), but then all your local internet DNS lookups would need to use the VPN to hit the other router for their lookups, not really ideal. Or if you only care about it on the "non-home" router you can leave DNS enabled on both routers and only do the script on the non-home router to get back to the "home" hostnames. That way your non-home router does all your lookups at the non-home site, including the IPs of the home devices, and the home router acts as normal, it doesn't know about hostnames for the non-home devices, only its own LAN and internet.

2. Put the routers into two different domains (LAN1 and LAN2 for example, or home1.net and home2.net). On each router use the dnsmasq.postconf script to add a forwarder to tell it to forward lookups for the remote domain to the remote router's IPs. Again you could do this on both routers or just one depending what you need. Then everything after that is done in the GUI, hosts that report their hostname will already be in DNS and their IPs will update automatically, and ones you want to customize you use DHCP reservations for and set the hostname there. Disadvantage here is you will need to specify the domain on your lookups, at least for the remote IPs, shouldn't be a huge deal though.
Only certain traffic. Sounds like I need to get my hands dirty and ssh in to each router to set this up. Thank you!
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top