Address by computer name instead of IP address in WireGuard VPN?

My Brume 2 is at 10.0.0.1. My main computer/server is a Mac, located at 10.0.0.2. On my LAN, I can connect to this Mac at 10.0.0.2 AND at “mac.local”.

I have a working WireGuard VPN at 10.0.8.1. When connected, I can reach the Brume 2 at 10.0.0.1, and my Mac at 10.0.0.2. But, I cannot connect to “mac.local”.

How can I tell the Brume 2 / WireGuard how to get to “mac.local”?

When the vpn is connected, your computers will be using the DNS of the vpn which does not know about Mac.local !

The easiest way to do this is to add dns record in the hosts file of the machine that initiates the connection to Mac.local

The easiest way to do this is to add dns record in the hosts file of the machine that initiates the connection to Mac.local

The device initiating the connection is an iPhone.

The machine in between is the Brume 2.

I don’t think either of these can hold a hosts file.

When the vpn is connected, your computers will be using the DNS of the vpn which does not know about Mac.local !

Yes. How do I tell the WG server to route requests for mac.local?

Go to NETWORK → DNS → in the upper right corner click Edit Hosts

Once the window opens, enter your Mac ip and host name click save.

Disable and re-enable the vpn and test.

I added the second line and restarted WireGuard but I’m still not able to reach by computer name.

127.0.0.1 localhost
10.0.0.2 mac.local
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Can you reach it by ip?

Yes. I can reach by IP.

Can you ping it and paste the result

I can’t ping from an iPhone.

How do you usually access it ? From browser ?

He’s using his own VPN WG Server.

@ johnc

^It’s not the way I’d do it but I don’t see why it wouldn’t work. I’d set some static DHCP leases beforehand, just to be sure: GL GUI → Clients → Online Clients → $clientName → Action → Modify

Another or option is to use LuCI → Network → DHCP and DNS → Static Leases which will give you the equivalent of → Hostnames (result: iphone.lan). You can install LuCI via GL GUI → System → Advanced Settings. Be warned there’s been a lot of changes since 2005/2006.

I access it through the Files app on my iPhone.

10.0.0.2 / mac.local hosts an SMB server.

In the Files app on my iPhone, I connect to this computer by smb://mac.local

This works on my LAN, of course. I wish for this same connection to work over my WireGuard VPN. (I know that I could use smb://10.0.0.2 just fine on/off my LAN, but this is the scenario I’d like to resolve).

OpenWrt DHCP defaults to .lan instead. .local creates conflicts w/ other DNS-based software used by Windows/Linux because Apple decided some years ago to ‘hijack’ that particular pseudo-TLD.

LuCI → Network → DHCP and DNS → General Settings → Local server & Local domain

So, I replace as follows?

John, before you continue configuring various options for your Burme 2 (eg: editing your hosts file as @SpitzAX3000 suggested), I’d highly suggest you back up your current state.

See the following:

Hypothetically, yes… but keep in mind that caveat I mentioned re: pseudo-TLD. You could have some troubles in the future if you start mixing other client operating system on your LAN.

I would really preform a backup first. It’s all in that HOW-TO. Keep that resulting tarball in a safe place.

Instead of changing these settings just edit your Mac server name from mac.local to mac. Then disconnect it from the router and reconnect again to have it as mac.lan

1 Like

Thanks for the tip. Would these LuCI changes I’m making be reset if I hard-reset (10 seconds) the Brume 2?