From owner-freebsd-bugs@freebsd.org Tue Aug 30 22:51:22 2016 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0702ABC9255 for ; Tue, 30 Aug 2016 22:51:22 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D183BE57 for ; Tue, 30 Aug 2016 22:51:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u7UMpLXU022817 for ; Tue, 30 Aug 2016 22:51:21 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 212272] w(1): 'w -n' makes bogus DNS queries Date: Tue, 30 Aug 2016 22:51:21 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 11.0-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: citrin+pr@citrin.ru X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Aug 2016 22:51:22 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D212272 Bug ID: 212272 Summary: w(1): 'w -n' makes bogus DNS queries Product: Base System Version: 11.0-STABLE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: bin Assignee: freebsd-bugs@FreeBSD.org Reporter: citrin+pr@citrin.ru Created attachment 174235 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D174235&action= =3Dedit Path to revert r199655 When tmux is used, utmp file (/var/run/utx.active) contains strings like tmux(1104).%1, tmux(1104).%2 and so on in hostname field. 'w -n' command tries to resolve tmux(PID).%PTS strings, which causes delay = and unnecessary load on root DNS servers. This behavior was introduced in r199655: https://svnweb.freebsd.org/changeset/base/199655 Problems with such behavior: 1. It not exactly matches documentation. Man says about -n flag "Do not att= empt to resolve network addresses (normally w interprets addresses and attempts = to display them as names)" and says nothing about resolving host to IP. 2. Even if man page will be updated to match current implementation this behavior will be not consistent with other commands: -n for most other comm= ands means "no DNS resolving at all". 3. if tmux (and may be screen) is used, 'w -n' makes bogus DNS queries, whi= ch end up on root DNS servers. I hope we don't want next paper like "Analysis = of DNS root server bogus queries" to contain paragraph about FreeBSD. Patch to remove host->IP resolving (revert r199655) with -n is attached (pa= tch against stable/11, but should apply on head). Another option is to check, that host string to contains only [a-zA-Z0-9_.] before resolving. I don't like it because: 1. pre r199655 'w -n' behavior matches 'w -n' on NetBSD and -n flag in other commands. 2. w.c is already complicated (for the simple task it performs) lets don't = make it more complicated 3. If somebody want to see only IP in 'w -n' output it is better to run sshd with -u0 flag, than resolve twice: IP to host in sshd and host to IP in 'w = -n' command. --=20 You are receiving this mail because: You are the assignee for the bug.=