how to set hostname on a cable line?

Dave Cottlehuber dch at skunkwerks.at
Wed Mar 21 23:57:36 UTC 2018


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


More information about the freebsd-questions mailing list