Reach nodes and applications by name
A Guard network can name its nodes, so that people and services reach a
node as router.hq.acme.guard.example.com instead of 100.64.1.7. It can
also publish an application that lives on a LAN, such as
files.acme.lan, to the nodes you grant it to. Every answer comes from a
resolver inside the tunnel on each node, and only the names Guard owns are
sent to it. The host’s other DNS settings don’t change.
Before you begin
Section titled “Before you begin”- Guard control plane 0.24.1 or later and Guard console 0.20 or later on the install. On 0.23 and 0.24.0 names work, but traffic to an application doesn’t return through its serving node.
awguard0.17 or later on every node that should resolve or serve names. A node on an older release keeps working and sees no names.awctl0.28 or later for the commands on this page.- A
tenantAdminornetworkAdminrole on the Guard tenant. - The estate’s domain on the control plane. The operator sets it in
the Guard server’s
estate.domainSuffixes; the first entry becomes the last part of every name. It’s required: a control plane without it doesn’t start.
How names are built
Section titled “How names are built”A node’s full name is four labels under the estate:
NODE.NETWORK.TENANT.guard.ESTATE| Label | Where it comes from | Example |
|---|---|---|
NODE | The node’s Slug on its page in the console. The control plane assigns one when a node enrols, derived from its display name. | router |
NETWORK | The network’s Short name on its page. Optional until you want names. | hq |
TENANT | The Guard tenant’s short name, set when the tenant is created. | acme |
ESTATE | The first entry of the control plane’s estate.domainSuffixes. | example.com |
Names are served only when both the network and the tenant have a short name. A network without one has no names, and its nodes leave the host’s DNS alone.
Slugs are lowercase DNS labels, unique within their network. A node’s slug
can’t begin with nd-, and a tenant’s can’t begin with gt-, because
those are the forms of their IDs. Renaming a node’s display name doesn’t
change its slug.
Name a network and its nodes
Section titled “Name a network and its nodes”- In the console, open the network and, under Identity, enter a
Short name, such as
hq. Click Save. - Open each node and check its Slug under Identity. Change it if the derived one isn’t what people should type. Name on the mesh shows the full name once the network and tenant are both named.
With awctl, in the Guard tenant’s context:
awctl guard networks update NETWORK_ID --slug hqawctl guard nodes update NODE_ID --slug routerawctl guard nodes listReplace NETWORK_ID and NODE_ID with the IDs (n-…, nd-…), or use
the network’s slug in the form TENANT/NETWORK. The list shows each
node’s slug. To see the mesh domain the network serves, run
awctl guard networks describe NETWORK_ID; its mesh_domain is empty
until both short names are set.
Every node in the network receives the new names on its next configuration poll, within a minute.
How a node resolves names
Section titled “How a node resolves names”Each node answers DNS at 100.100.100.1 from inside its tunnel. A query
to that address never leaves the machine, and nothing listens on port 53.
The resolver answers only from the configuration the node is running:
- an
Arecord for the node itself and for every peer it may reach; - a
PTRrecord for those addresses; NXDOMAINfor any other name under the mesh domain;REFUSEDfor any name outside it.
A peer this node can’t reach has no name, just as it has no route. A grant
works in both directions for names: when node A is granted node B, each
resolves the other. The resolver never forwards a query anywhere, and it answers AAAA with an
empty response because the mesh is IPv4.
The node sends only the mesh domain, the reverse zones its addresses sit in, and any application names it’s granted to that resolver. Every other name stays with the resolver the host already uses.
Linux with systemd-resolved
Section titled “Linux with systemd-resolved”The node sets per-link DNS on its tunnel interface with resolvectl: the
resolver address, the mesh domain as a routing domain, and no default
route. awguard status reports the plumbing as resolved.
Linux without systemd-resolved
Section titled “Linux without systemd-resolved”The node changes nothing and logs one warning naming the domain to route.
awguard status reports the plumbing as manual. Route the mesh domain
to 100.100.100.1 with the resolver the host uses. With dnsmasq, for
example:
server=/hq.acme.guard.example.com/100.100.100.1The node never edits /etc/resolv.conf.
The node writes one file per domain under /etc/resolver/, each starting
with a comment that marks it as written by awguard. awguard status
reports the plumbing as resolver-files. dig and nslookup bypass
/etc/resolver/, so check with dscacheutil -q host -a name NAME or
ping NAME. Applications see the names.
Windows
Section titled “Windows”Not supported yet. The resolver answers at 100.100.100.1, but the node
doesn’t configure a name resolution policy for the domain.
Publish an application on a LAN
Section titled “Publish an application on a LAN”An application resource is a hostname on a LAN, such as
files.acme.lan, served by one or more nodes on that LAN. A node granted
the resource resolves the name to the application’s real addresses, and
its traffic to those addresses goes through a serving node.
- In the console, open the network, go to Resources, and click New resource.
- Select the kind Application, enter the hostname in Address, and under Served by select the node or nodes on that LAN.
- Click Create resource, then grant it to the nodes that should reach it, as for any resource: open each node, go to Grants, and add the resource.
With awctl:
awctl guard resources create \ --kind application \ --address files.acme.lan \ --display-name "File server" \ --serving-node-ids NODE_IDawctl guard nodes add-grants CLIENT_NODE_ID resources/RESOURCE_IDReplace NODE_ID with the serving node’s ID, separating several with
commas, and RESOURCE_ID with the ID the first command prints. The grant
names its target as resources/… because a node can also be granted
another node, as nodes/….
What the serving node does
Section titled “What the serving node does”The serving node looks the hostname up through its own resolver once a minute, as any program on that host would, and reports the IPv4 addresses it finds to the control plane. Make sure that node’s resolver can resolve the name; it’s the only one that’s asked. An answer stands for ten minutes from the lookup that found it, and a changed answer reaches the control plane within about 15 seconds.
When a lookup fails:
nxdomainclears the addresses at once, because the name doesn’t exist or has no IPv4 address;timeoutorerrorkeeps the last good addresses until they lapse, so one slow DNS server on the LAN doesn’t cut clients off.
awguard status on the serving node shows a serves line per name with
its addresses, or the reason it has none.
What a client sees
Section titled “What a client sees”Each granted name is routed to 100.100.100.1 like the mesh domain and
answered there with the addresses of every node serving it. A name below
an application name gets NXDOMAIN. Traffic to those addresses goes
through the serving node’s tunnel. awguard status on the client shows
an app line per name. The resource’s page in the console shows the
addresses each serving node reported under Application addresses, and
the resource list shows served once any serving node has reported an
address.
A node never answers a name it serves itself. Its own lookups of that name go to the LAN.
Addresses the control plane refuses
Section titled “Addresses the control plane refuses”The control plane refuses a reported address, logs it, and shows it as refused on the resource’s page when it:
- isn’t a unicast IPv4 address;
- is inside the mesh’s own address range;
- is inside a subnet or host that a different node serves, because the more specific route would silently take that node’s traffic.
An address inside a subnet the same node already serves is fine. Two nodes serving one application with different addresses is the high-availability case: the client gets both.
Wildcard names such as *.acme.lan aren’t supported.
Check that names work
Section titled “Check that names work”On a node that should resolve names:
awguard statusThe dns line shows the node’s own name, the plumbing in use, and how
many queries the resolver answered since it started, with the NXDOMAIN
and REFUSED counts. The peer table has a NAME column. app lines list
granted applications, and serves lines list the ones this node serves.
To ask the resolver directly, on any platform:
dig @100.100.100.1 router.hq.acme.guard.example.comdig @100.100.100.1 -x 100.64.1.7awguard status --json carries the same information under dns and
serving: dns.plumbing is resolved, resolver-files, manual,
failed, or off; dns.routed lists the domains sent to the resolver;
dns.applications lists the granted names with their addresses.
If a name doesn’t resolve:
dnsis missing from the status. The network or tenant has no short name, or the control plane is older than 0.22. Set both short names.- Plumbing is
manual. The host has no systemd-resolved. Route the domain yourself, as described above. - Plumbing is
failed. The node’s log says what failed, usually aresolvectlcall or a file it couldn’t write under/etc/resolver/. NXDOMAINfor a peer’s name. This node isn’t granted that peer, or the peer has no slug.- An application name has no addresses. Check
awguard statuson the serving node: aservesline withnxdomainmeans the serving node’s own resolver can’t resolve the name. A refused address on the resource’s page names the rule it broke.
What a stop cleans up
Section titled “What a stop cleans up”When awguard stops, it removes the DNS settings it made along with its
routes and firewall rules: the per-link settings on Linux with
systemd-resolved, and its own files under /etc/resolver/ on macOS. It
never removes a resolver file it didn’t write. If the process is killed
without a chance to clean up, the next start sweeps the same settings
before applying new ones.
What’s next
Section titled “What’s next”- CLI: the
awctl guardcommand group and how to set the Guard tenant and network context.