From owner-freebsd-questions@freebsd.org Wed Mar 21 22:23:03 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B609F6C7B0 for ; Wed, 21 Mar 2018 22:23:03 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE3156BE97 for ; Wed, 21 Mar 2018 22:23:02 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([92.195.125.64]) by mrelayeu.kundenserver.de (mreue006 [212.227.15.167]) with ESMTPA (Nemesis) id 0MU8aj-1f7oYY0Vaj-00QmWa; Wed, 21 Mar 2018 23:22:55 +0100 Date: Wed, 21 Mar 2018 23:22:54 +0100 From: Polytropon To: Anton Shterenlikht Cc: freebsd-questions@freebsd.org Subject: Re: how to set hostname on a cable line? Message-Id: <20180321232254.3a2dc696.freebsd@edvax.de> 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> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:pCMWxV2S8eJQIXk1jsGMYbBNGgZfufL1ddqdvGi5F+OMxihzKfG kTvN/COCoXlDVxORXULSGml7mg0O9pUH/9uCh73eHGSJ2SMKP9h2HwbQhsWfppCCvKvvXPO HJ3Mg3/sZUKpHWLYrB7uPn+dYZAiGRzafGhNp6OReEC6TGJ3Y9K8CmgZZAwFl4osXjHB1kt fHy4MS3ogU2Z4cVZJPqWw== X-UI-Out-Filterresults: notjunk:1;V01:K0:DSRlWLfAL14=:EXek3T31AV7UAXq2IYgOqN E0hsCHzKUBCetpeQzYwX5imRLo8LHbUcdh9ktTDRJsJ/N11XmG3VSu8QybpuUBybr//igbkeW wvPFEAncQzY9+eCcVq+GbrHeKFCFfD3QRDFD76q1BU+waVot97Kc4qj7OKtAvR6QXJPL2XSMp 6091ZdbLVeBDzgjPxAbgjDa6g1D8qKPkjlwlY7qJT+c4eC/SWeDVNkjWwWSaut1nk7he6ckLg RNk7AXtHtoMVkUhLQ9e82b8LiERDid3CLb2lcRzbVaoXQsTSGTQq+ji8AuRxEShSpkC5RxG3q ol+WScPcb9tzWGTVvTMhA57WUruRG9RMhlqz7ntGgI5ktERhSpzePbGpDRQUYRxaFQlRdwBdQ iPLx3bGq2LBfeWlcWo44eAnqzLAuuml2asnzuWd9b8/IRV3cECIvjhgyXUlA8gHaYYz6xrAMN +ahGRNAFdNRZuEq5p1OHD8Ccd82X8Dci0IWuBx9BS3S9Q7BwygGyQqttXYfITKX/che3QX+In dMEIAr1jy0+ZC1k/PFcdGr/wJABoko0svfzn9PSKf31XIhjs6cwqwCJoIhLrqkUNuvcP9DxFh DXH9VS6b0aE4yKE2MWP6AtDxwC6Wgsp8hs0pidorN+K0dtBDSzFSvhIfNvAa1VAZ662m/nICz I5e9QONRHNe+Cpe2dDNil4RcRVVm5pOGDog/BRJ3ZwiXdOjGVufDtjgXsmzXOuCEZKSYDH33Q 6Upbn88IJpSfgFxWJoaEqWsyTOzxeN+tkAvYBI0ckEEk4oAGejhYP8gL2mE= X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2018 22:23:03 -0000 On Wed, 21 Mar 2018 21:30:05 +0000, 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: > > > > > > # hostname > > > > > > # > > > > > > # cat /var/db/dhclient.leases.wlan0 > > > lease { > > > interface "wlan0"; > > > fixed-address 192.168.1.104; > > > next-server 192.168.1.1; > > > option subnet-mask 255.255.255.0; > > > option routers 192.168.1.1; > > > option domain-name-servers 194.168.4.100,194.168.8.100; > > > option host-name "00215c5068c3"; > > > option domain-name "cable.virginmedia.net"; > > > option dhcp-lease-time 86400; > > > option dhcp-message-type 5; > > > option dhcp-server-identifier 192.168.1.1; > > > 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 > > > search cable.virginmedia.net > > > nameserver 194.168.4.100 > > > nameserver 194.168.8.100 > > > > > > > > > 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? > > > > > > Thanks > > > > > > Anton > > > > > > Have you tried setting the hostname with 'bsdconfig networking' ? > > Maybe I didn't explain myself well. > > I need a fully qualified domain name (FQDM). > > Perhaps I just cannot have one from a wireless router > at home? Check the configuration of the device that hands out configuration data via DHCP to check if you can define the FQDN from within there. If not, you can always manually set it using hostname="fqdn.example.com" in /etc/rc.conf (or using "bsdconfig networking" interactively). If yout DHCP server runs FreeBSD + isc-dhcpd, you can use its configuration file dhcpd.conf with the setting option domain-name "fqdn.example.com"; to have it send a FQDN to a specific host upon DHCP request; make sure that only the intended machine will receive that one FQDN, for example by using its MAC address for correct identification: host someserver { hardware ethernet 00:11:22:33:44:55; fixed-address 123.45.678.90; option domain-name "fqdn.example.com"; } See "man dhcpd.conf" for details (in case this applies). -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...