From owner-freebsd-questions@FreeBSD.ORG Thu Jan 8 12:47:39 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 9AEA5EF3 for ; Thu, 8 Jan 2015 12:47:39 +0000 (UTC) Received: from BLU004-OMC4S4.hotmail.com (blu004-omc4s4.hotmail.com [65.55.111.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "*.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCD3B56 for ; Thu, 8 Jan 2015 12:47:39 +0000 (UTC) Received: from BLU436-SMTP59 ([65.55.111.136]) by BLU004-OMC4S4.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22751); Thu, 8 Jan 2015 04:46:32 -0800 X-TMN: [mg0DV3s6XQAYqpVwPf3eFkGbgJ2hdYwi] X-Originating-Email: [bourne.identity@hotmail.com] Message-ID: Date: Thu, 8 Jan 2015 18:16:22 +0530 From: Manish Jain User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: freebsd-questions@freebsd.org Subject: Running resolvconf from script References: In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 08 Jan 2015 12:46:30.0644 (UTC) FILETIME=[202D1B40:01D02B41] 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: Thu, 08 Jan 2015 12:47:39 -0000 Hi, I am on FreeBSD-10.1-i386. For some reason, DNS information on my system sometimes 'evaporates' and I am left with no network access. To restore internet, I have to execute the following sequentially (re0 is my ethernet card and /etc/nameservers.list is a file I created which contains the list of nameservers) : ifconfig re0 down ifconfig re0 up resolvconf -d re0 resolvconf -a re0 < /etc/nameservers.list While the sequence works well and restores internet, I would ideally like to move the commands into a Bash shell script. But executing the resolvconf commands from a script results in an error message "No resolv.conf for re0" (or something to that effect) and 'resolvconf -l re0' returns an empty/incomplete list, with no internet working yet. So is there any way I can automate the work via a script ? Thanks and Regards, Manish Jain +91-98995-82709