Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Mar 2018 00:57:35 +0100
From:      Dave Cottlehuber <dch@skunkwerks.at>
To:        Anton Shterenlikht <as@cmplx.uk>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: how to set hostname on a cable line?
Message-ID:  <1521676655.2542368.1311667264.1D0DED02@webmail.messagingengine.com>
In-Reply-To: <20180321213005.GA73927@jail0199.vps.exonetric.net>
References:  <201803211834.w2LIY9Jh059885@jail0199.vps.exonetric.net> <79cc198c-daa9-1cb2-020f-d11d7d3d396a@yandex.com> <20180321213005.GA73927@jail0199.vps.exonetric.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 21 Mar 2018, at 22:30, Anton Shterenlikht wrote:
> On Thu, Mar 22, 2018 at 12:47:50AM +0530, Manish Jain wrote:
> > On 03/22/18 00:04, Anton Shterenlikht wrote:
> > > I cannot seem to set hostname
> > > correctly on a home laptop,
> > > which has a wireless connection
> > > to a cable router.
> > > 
> > > How do I do it?
> > > 
> > > I have
> > > 
> > > hostname=""
> > > ifconfig_wlan0="SYNCDHCP WPA"
> > > 
> > > in /etc/rc.conf
> > > 
> > > According to rc.conf(5):
> > > 
> > >                   If dhclient(8) is used to set the hostname via DHCP, this
> > >                   variable should be set to an empty string.
> > > 
> > > But I still get empty hostname after boot:


There is possibly a setting on your router to address this, but I use the
following dhclient settings which will override whatever your wifi router
decides to send you.

# /etc/dhclient.conf 
# $FreeBSD$
#
#	This file is required by the ISC DHCP client.
#	See ``man 5 dhclient.conf'' for details.
interface "wlan0" {
   send host-name "yourhost.example.org";
   send dhcp-lease-time 864000;
   supersede domain-search "example.org";
   supersede domain-name-servers 9.9.9.9;
   request subnet-mask, broadcast-address, time-offset, routers;
}

A+
Dave



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1521676655.2542368.1311667264.1D0DED02>