Skip to content

sinanmohd/namescale

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Namescale

Badge Matrix

Namescale automatically registers Wildcard DNS names for devices in your Tailnet

Table of Contents

  1. Deployment
  2. Development

Deployment

NixOS

Tip

Example setup on NixOS with ACLs

Add namescale to your NixOS flake
{
  description = "Bane's NixOS configuration";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

    namescale = {
      url = "github:sinanmohd/namescale";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = inputs@{ nixpkgs, namescale, ... }: {
    nixosConfigurations = {
      hostname = nixpkgs.lib.nixosSystem {
        system = "x86_64-linux";
        modules = [
          ./configuration.nix
          namescale.nixosModules.namescale
        ];
      };
    };
  };
}

Set up namescale in your configuration.nix

{ ... }: {
    services.namescale = {
        enable = true;
        settings.tsnet. = {
            coordination_server_url = "https://headscale.example.com";
            # services.namescale.environmentFile with TS_AUTHKEY is
            # recommended for production
            auth_key = "<your tailnet pre auth key>";
        };
    };
}

Using Split DNS make your tailnet to routes all DNS requests to your base domain to Namescale , on Tailscale you can use the Web GUI for this. if you're using Headscale you can do the following in your configuration.nix.

{ ... }: {
    services.headscale.settings.dns = {
        base_domain = "bane.ts.net";
        nameservers.split."bane.ts.net" = [ "100.64.0.6" ];
    };
}

GNU/Linux Distros

Make sure Tailnet is up and running on your node and build Namescale

git clone https://github.com/sinanmohd/namescale.git
cd namescale
go build ./cmd/namescale

Run Namescale

./namescale \
    -auth-key="<your tailnet pre auth key>" \
    -coordination-server=https://headscale.example.com

Using Split DNS make your tailnet to routes all DNS requests to your base domain to Namescale , on Tailscale you can use the Web GUI for this. if you're using Headscale you can do the following in your headscale.yaml.

dns:
  base_domain: bane.ts.net
  nameservers:
    split:
      bane.ts.net:
      - 100.64.0.6

Kubernets & Docker

Run the container image

docker run \
    -v namescale:/.config/ \
    sinanmohd/namescale:latest \
    namescale \
    -auth-key="<your tailnet auth key>" \
    -coordination-server=https://headscale.example.com

Build container image

nix build .#container
docker image load < result
docker tag sinanmohd/namescale:git sinanmohd/namescale:latest

Development

# get namescale
git clone https://github.com/sinanmohd/namescale.git
cd namescale

# setup development environment
nix develop

# run checks
nix flake check

# build go binary
go build ./cmd/namescale

# build nix package
nix build

# build and load container image
nix build .#container
docker image load < result

About

Zeroconf Wildcard DNS for Tailscale

Resources

License

Stars

Watchers

Forks

Packages

No packages published