Skip to content

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.

  • 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.
  • awguard 0.17 or later on every node that should resolve or serve names. A node on an older release keeps working and sees no names.
  • awctl 0.28 or later for the commands on this page.
  • A tenantAdmin or networkAdmin role 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.

A node’s full name is four labels under the estate:

NODE.NETWORK.TENANT.guard.ESTATE
LabelWhere it comes fromExample
NODEThe node’s Slug on its page in the console. The control plane assigns one when a node enrols, derived from its display name.router
NETWORKThe network’s Short name on its page. Optional until you want names.hq
TENANTThe Guard tenant’s short name, set when the tenant is created.acme
ESTATEThe 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.

  1. In the console, open the network and, under Identity, enter a Short name, such as hq. Click Save.
  2. 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:

Terminal window
awctl guard networks update NETWORK_ID --slug hq
awctl guard nodes update NODE_ID --slug router
awctl guard nodes list

Replace 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.

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 A record for the node itself and for every peer it may reach;
  • a PTR record for those addresses;
  • NXDOMAIN for any other name under the mesh domain;
  • REFUSED for 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.

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.

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.1

The 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.

Not supported yet. The resolver answers at 100.100.100.1, but the node doesn’t configure a name resolution policy for the domain.

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.

  1. In the console, open the network, go to Resources, and click New resource.
  2. Select the kind Application, enter the hostname in Address, and under Served by select the node or nodes on that LAN.
  3. 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:

Terminal window
awctl guard resources create \
--kind application \
--address files.acme.lan \
--display-name "File server" \
--serving-node-ids NODE_ID
awctl guard nodes add-grants CLIENT_NODE_ID resources/RESOURCE_ID

Replace 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/….

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:

  • nxdomain clears the addresses at once, because the name doesn’t exist or has no IPv4 address;
  • timeout or error keeps 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.

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.

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.

On a node that should resolve names:

Terminal window
awguard status

The 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:

Terminal window
dig @100.100.100.1 router.hq.acme.guard.example.com
dig @100.100.100.1 -x 100.64.1.7

awguard 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:

  • dns is 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 a resolvectl call or a file it couldn’t write under /etc/resolver/.
  • NXDOMAIN for 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 status on the serving node: a serves line with nxdomain means the serving node’s own resolver can’t resolve the name. A refused address on the resource’s page names the rule it broke.

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.

  • CLI: the awctl guard command group and how to set the Guard tenant and network context.