From owner-freebsd-questions@FreeBSD.ORG Fri Feb 20 21:26:01 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ECD3FDEE; Fri, 20 Feb 2015 21:26:01 +0000 (UTC) Received: from mail-oi0-x229.google.com (mail-oi0-x229.google.com [IPv6:2607:f8b0:4003:c06::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B34EAC43; Fri, 20 Feb 2015 21:26:01 +0000 (UTC) Received: by mail-oi0-f41.google.com with SMTP id z81so4799670oif.0; Fri, 20 Feb 2015 13:26:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=/169ee5bUv1QvH6xjjwhb8tXoTVqZe6lPV9f3zoWJ6I=; b=zucNJs+hyRESj1Xrzdw6ZHVZaRz8k12b4F1k96j18bu7D44HnDrYAT4V+xq5wgYB+6 SJDTfDO58josI+bLD0KTpHeX4HXIJTbwBQ6ANhyI6BJFpH5bUZYSQpv8xNkW8ubToseO PWuq7c1oavFuY4XiodyOymHZw/ueRC3CAIpM0JHWjE8fUN6Fk5keXEMDLcpYRnSqHfeh ZEUr/tEIhHtpHUBEDN9Ey8nNpJQXCJh59uThtItgJvxaPW/lpHSM9WL/PK8L2xdDdgKq YTb3pwgpiRlAJc0xFMijyB39kH0hTIVtgzzzFTE9zrAgjJB6gWfRi9c+9DLFBofk6Jk5 69yA== MIME-Version: 1.0 X-Received: by 10.202.46.138 with SMTP id u132mr7526051oiu.19.1424467561077; Fri, 20 Feb 2015 13:26:01 -0800 (PST) Received: by 10.60.140.199 with HTTP; Fri, 20 Feb 2015 13:26:01 -0800 (PST) Date: Fri, 20 Feb 2015 16:26:01 -0500 Message-ID: Subject: Resolver needs bind to src IP option From: grarpamp To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=UTF-8 Cc: freebsd-current@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2015 21:26:02 -0000 I looked through these pages and did not see an option to bind the resolver query from a specific IP address (as in the case where you have multiple interfaces and/or alias addresses and wish to pick one instead of the default route). resolver(3) gethostbyname(3) resolver(5) [resolv.conf] You could steer them with NAT filter, or bind a local unbound/named to a src IP and point the resolver at that. But those seem heavier weight solutions than doing it in the resolver natively (whether in resolv.conf or in library calls by applications [where in the apps case, resolv.conf would decide whether application call or resolv.conf takes precedence]). Thoughts?