Hi pjft,
A route is an IP address only, not a name. And you can't route a tunnel through itself: I've seen users do this, and of course it immediately becomes non-functional.
Tin's idea is partly right, but it's wrong to use the
.local top-level domain in DNS. It is reserved for the mDNS (zeroconf) protocol. Best is to use a domain name you own -- but obviously (?) not the same name you are using to establish the tunnel.
Often the best tool for this is
dnsmasq(8). Let's say you own example.com and it is at 192.0.2.80, and we'll further suppose a VPN server address there of 172.16.16.1; use this as
/etc/hosts:
# this line is not needed if you have that name and address in global DNS
192.0.2.80 vpn.example.com
172.16.16.1 example.com
172.16.16.1 www.example.com
Then tell the client machine to connect to
vpn.example.com, and all DNS lookups for
example.com and
www.example.com will return the VPN server IP address,
172.16.16.1.
This assumes an always-on tunnel, because connections to "example.com" will fail if there is no VPN.
hth, regards, rob0