how to set hostname on a cable line?

Anton Shterenlikht as at
Wed Mar 21 18:34:12 UTC 2018

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

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:

# hostname


# cat /var/db/dhclient.leases.wlan0
lease {
  interface "wlan0";
  option subnet-mask;
  option routers;
  option domain-name-servers,;
  option host-name "00215c5068c3";
  option domain-name "";
  option dhcp-lease-time 86400;
  option dhcp-message-type 5;
  option dhcp-server-identifier;
  option dhcp-renewal-time 43200;
  option dhcp-rebinding-time 75600;
  renew 4 2018/3/22 07:21:14;
  rebind 4 2018/3/22 16:21:14;
  expire 4 2018/3/22 19:21:14;

# cat /etc/resolv.conf
# Generated by resolvconf

Does that help me?

I cannot run MPI programs without having a correct
hostname, i.e. I should be able to do ssh `hostname`.

What am I missing?



More information about the freebsd-questions mailing list