From owner-freebsd-net@freebsd.org Tue Jan 5 14:43:18 2021 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E8974E6919 for ; Tue, 5 Jan 2021 14:43:18 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com [IPv6:2607:f8b0:4864:20::f2c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D9Fbn4ynHz4XdQ for ; Tue, 5 Jan 2021 14:43:17 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qv1-xf2c.google.com with SMTP id a4so14704654qvd.12 for ; Tue, 05 Jan 2021 06:43:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=7P4WU2NfG90rIUGnSgtrhlASVN/NqrWbgmdJApC1WD8=; b=ejniEdY0p740wMa/Ger6q2Y6YdRc2hrQZKvYCn4Z6M9HCY2y6lvMeoFY5hu67NWigW EnkSlfQJH0vqyXq6ZVOw0mOSHIFhX1IPE3yiEYlg09XPHsDH9yaI3h0Cvq3lKU8Wz7QB t/25NH/zVg9jcnhSVRs0tuKc00GzN0uOQTK9RprFNCnZSL+/E5nUfhuQFg+ZchlZYdjo tXmyTpijaUYHSV23E2gQM9irTvPR9zml5IrIVIdDZUUMhCeye1MSWz9lwWXLUKN0rIKZ gOS4a2YhaUgLvPKIvOo6LgC+D0FweKmw099zKqjTwSqDyaPwlvrlOnXczlyI/NHdH+7U 1Huw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=7P4WU2NfG90rIUGnSgtrhlASVN/NqrWbgmdJApC1WD8=; b=lZFFQ1WE4uufh17v+nNvP68tkj0bw7bObhvLHiegTS2xj67g4D/NZskCREdpGd/T7x y2GhiWqhJrdUZJFZfghiNqgZzn+p21XlGAj3sP/QIPVho6Itv7EPVFMUaaXvXWIzijG6 KQZfhcD9pqXa6rQbujQra+Tc1p6zSjyL9rVibafJP40KOkWWRXHV9li9WFe3d9fMc8nR pMoh2DTVtQmQyj8auXbyBFEE+nKgyIyy4ts+a+GqQmW39hZS7ovioBwOwYs0eER0MaU+ IzO+x71ERZYIgA24yGfrHrVs1wSKVvBQJ56XiuTnlOyUrhZJLAtCixrzW5cI+7M2b7VV OEKw== X-Gm-Message-State: AOAM530wQSj2vWOzog5zPpTBN/5vhmKK15aGExS3JdZk0Fk8Nyfv4ZVm Q+zgnlpG0RIVp/ZPULGilvE= X-Google-Smtp-Source: ABdhPJyM9YJeQh6e6gi2Hukfc7+5MUYs86y26Xhp8kFGS6uDr5UWFSE6+SFRjILdb6sBoW9uxiv82Q== X-Received: by 2002:a0c:a5a5:: with SMTP id z34mr81132937qvz.59.1609857796751; Tue, 05 Jan 2021 06:43:16 -0800 (PST) Received: from raichu ([142.126.164.150]) by smtp.gmail.com with ESMTPSA id d123sm32235qke.95.2021.01.05.06.43.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Jan 2021 06:43:16 -0800 (PST) Sender: Mark Johnston Date: Tue, 5 Jan 2021 09:43:14 -0500 From: Mark Johnston To: Vasily Postnicov Cc: freebsd-net@freebsd.org Subject: Re: DNS using Name Service Switch module and Casper Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4D9Fbn4ynHz4XdQ X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=ejniEdY0; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::f2c as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-2.70 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::f2c:from]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-net@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::f2c:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f2c:from]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-net] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2021 14:43:18 -0000 On Tue, Jan 05, 2021 at 10:02:37AM +0300, Vasily Postnicov wrote: > Hello. I wrote a simple daemon called ZeroDNS which provides functionality > similar to multicast DNS, namely it discovers other participating machines > over the LAN and stores their hostname and IPv4 address pairs. > > Here is a NSS module which allows the system to use information from that > daemon: > https://github.com/shamazmazum/nss-zero-dns > > You need to modify /etc/nsswitch.conf, changing the line 'hosts: files dns' > to 'hosts: files dns zerodns'. > > It all works on FreeBSD 12.2-RELEASE, but sometimes not on 13.0-CURRENT. > For example, ping(8) just blocks when trying to ping a host whose name is > resolvable with ZeroDNS. Turns out that programs built with casper support > (like ping(8) and some others) stop working with my NSS module (they just > block trying to resolve the name). Presumably it's the casper process (i.e., cap_dns) that uses your module? If the main ping process is blocked trying to resolve a name, it's waiting for the cap_dns process - where exactly is it getting stuck? > Is there some kind of manual on how to write casper-compatible NSS modules?