From owner-freebsd-questions@FreeBSD.ORG Sun Aug 3 16:16:26 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4434037B401 for ; Sun, 3 Aug 2003 16:16:26 -0700 (PDT) Received: from mta7.pltn13.pbi.net (mta7.pltn13.pbi.net [64.164.98.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id C592443F93 for ; Sun, 3 Aug 2003 16:16:25 -0700 (PDT) (envelope-from dcrudy@pacbell.net) Received: from pacbell.net (adsl-67-124-156-171.dsl.pltn13.pacbell.net [67.124.156.171]) by mta7.pltn13.pbi.net (8.12.9/8.12.3) with ESMTP id h73NGKeC002880; Sun, 3 Aug 2003 16:16:20 -0700 (PDT) Message-ID: <3F2D97E7.3020802@pacbell.net> Date: Sun, 03 Aug 2003 16:16:55 -0700 From: Daniel Rudy Organization: SBC Internet Services User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en, ja MIME-Version: 1.0 To: "David S. Jackson" References: <20030803221318.GA13418@sylvester.dsj.net> In-Reply-To: <20030803221318.GA13418@sylvester.dsj.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-questions@freebsd.org Subject: Re: Finding your dynamic external IP X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: dcrudy@pacbell.net List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2003 23:16:26 -0000 Somewhere around the time of 08/03/2003 15:13, the world stopped and listened as David S. Jackson spoke these words of wisdom...: > If your external IP number changes, as with DHCP, is there a way > to find out what it currently is? I was thinking you could keep > BitchX logged into a chat channel and script a /dns yournick and > email yourself the results from time to time. > > How would you do it? > If you know what interface you are running on, then you can do this to get the IP address: ifconfig | head -2 | tail -1 | awk '{print $2}' to get the IP address. Then if you want to mail it to yourself, then you can do the following: /usr/bin/printf "Current IP address: `ifconfig | head -2 | tail -1 | awk '{print $2}'`\n" | /usr/bin/mail -s "IP Address Assignment" root & To update your Dynamic DNS, use the following: ddclient -use=if -if= This will run ddclient in daemon mode so that anytime the IP address changes on it will update the DDNS provider's servers. -- Daniel Rudy