Closed V3ntus closed 1 week ago
CC: @azahi listed as the maintainer of endlessh-go
on https://github.com/nixos/nixpkgs
I cannot reproduce this. You can try updating to the latest revision from here, I've disabled CGO in it, maybe this would help with DNS resolution in your case.
I've altered my config to reference the mentioned PR's changes, but I am still getting the DNS issues. I'll see about setting up resolved
in the meantime.
NixOS config:
{
config,
lib,
pkgs,
...
}:
let
endlessh-go = (import (builtins.fetchTarball {
url = "https://github.com/azahi/nixpkgs/archive/6a67984ae076908dd92c466911aa7ebabcf0f7b3.tar.gz";
}) {}).endlessh-go;
in {
systemd.services.endlessh-go.serviceConfig.ExecStart = let cfg = config.services.endlessh-go;
in lib.mkForce (lib.concatStringsSep " " ([
"${endlessh-go}/bin/endlessh-go"
"-logtostderr"
"-host=${cfg.listenAddress}"
"-port=${toString cfg.port}"
] ++ lib.optionals cfg.prometheus.enable [
"-enable_prometheus"
"-prometheus_host=${cfg.prometheus.listenAddress}"
"-prometheus_port=${toString cfg.prometheus.port}"
] ++ cfg.extraOptions));
}
systemctl status:
[ventus@nixos:~]$ sudo systemctl status endlessh-go.service
● endlessh-go.service - SSH tarpit
Loaded: loaded (/etc/systemd/system/endlessh-go.service; enabled; preset: enabled)
Active: active (running) since Mon 2024-05-06 18:59:15 UTC; 3min 0s ago
Main PID: 290593 (endlessh-go)
IP: 1.0K in, 1.8K out
IO: 0B read, 0B written
Tasks: 3 (limit: 1152)
Memory: 1.4M
CPU: 34ms
CGroup: /system.slice/endlessh-go.service
└─290593 /nix/store/ciszpmc2959ziyb4zwyq4qyy8j45ygwy-endlessh-go-2024.0119.1/bin/endlessh-go -logtostderr -host=x.x.x.x -port=22 -enable_prometheus -prometheus_host=x.x.x.x -prometheus_port=2112 -geoip_supplier=ip-api
May 06 18:59:15 nixos systemd[1]: Started SSH tarpit.
May 06 18:59:16 nixos endlessh-go[290593]: I0506 18:59:16.086026 290593 main.go:78] Listening on x.x.x.x:22
May 06 18:59:16 nixos endlessh-go[290593]: I0506 18:59:16.086325 290593 metrics.go:90] Starting Prometheus on x.x.x.x:2112, entry point is /metrics
May 06 19:00:42 nixos endlessh-go[290593]: W0506 19:00:42.666077 290593 metrics.go:128] Failed to obatin the geohash of x.x.x.x: Get "http://ip-api.com/json/x.x.x.x": dial tcp: lookup ip-api.com on [::1]:53: read udp [::1]:37016->[::1]:53: read: connection refused.
resolved
enabled and populated networking.nameservers
, but still same results.
{
networking.nameservers = [ "1.1.1.1#one.one.one.one" "1.0.0.1#one.one.one.one" ];
services.resolved = {
enable = true;
domains = [ "~." ];
fallbackDns = [ "1.1.1.1#one.one.one.one" "1.0.0.1#one.one.one.one" ];
dnsovertls = "true";
};
}
# /etc/resolv.conf
nameserver 127.0.0.53
options edns0 trust-ad
search .
Below is additional networking configuration. networking.useDHCP = false
may be another suspect?
Adding an entry to networking.hosts
has no effect either.
The systemd service is not able to resolve the geohash API host. Oddly it's pointing to localhost to try and resolve it.
resolveconf.service
is enabled and active. There are valid nameservers in/etc/resolv.conf
. I candig ip-api.com
just fine. Here's the systemd status for endlessh-go:Running on NixOS 23.11. Relevant config: