1.\" $OpenBSD: myname.5,v 1.9 2017/07/13 19:16:33 jmc Exp $ 2.\" 3.\" Copyright (c) 2003 Jason McIntyre <jmc@openbsd.org> 4.\" 5.\" Permission to use, copy, modify, and distribute this software for any 6.\" purpose with or without fee is hereby granted, provided that the above 7.\" copyright notice and this permission notice appear in all copies. 8.\" 9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16.\" 17.Dd $Mdocdate: July 13 2017 $ 18.Dt MYNAME 5 19.Os 20.Sh NAME 21.Nm myname , mygate 22.Nd default hostname and gateway 23.Sh DESCRIPTION 24The 25.Nm myname 26and 27.Nm mygate 28files are read by 29.Xr netstart 8 30at system startup time. 31.Pp 32.Pa /etc/myname 33contains the symbolic name of the host machine. 34The file should contain a single line specifying the 35fully qualified domain name 36.Pq FQDN 37of the system 38.Pq e.g. host.example.com . 39The name must be resolvable, either by matching a hostname specified in 40.Pa /etc/hosts 41(see 42.Xr hosts 5 ) 43or through DNS 44(see 45.Xr resolv.conf 5 ) . 46The hostname is set via the 47.Xr hostname 1 48utility at boot time. 49See 50.Xr hostname 7 51for a description of hostname resolution. 52.Pp 53.Pa /etc/mygate , 54if it exists, 55contains the address of the gateway host. 56The gateway is added to the routing tables by the 57.Xr route 8 58utility. 59If 60.Pa /etc/mygate 61does not exist, no default gateway is added to the routing tables. 62The file may contain gateway addresses for both IPv4 and IPv6 networks: 63in dotted quad notation for v4 64.Pq e.g. 192.0.2.1 65or in colon notation for v6 66.Pq e.g. 2001:db8::1 . 67Each address must be specified on a separate line. 68If more than one address of a specific family is found, 69only the first is used \- all other addresses of that family are ignored. 70.Pp 71.Pa /etc/mygate 72is processed after all interfaces have been configured. 73If any 74.Xr hostname.if 5 75files contain 76.Dq dhcp 77directives, 78IPv4 entries in 79.Pa /etc/mygate 80will be ignored. 81If they contain 82.Dq autoconf 83directives, 84IPv6 entries will be ignored. 85.Pp 86Empty lines and lines beginning with 87.Sq # 88in either file are ignored. 89.Sh FILES 90.Bl -tag -width "/etc/myname" -compact 91.It Pa /etc/myname 92Default hostname. 93.It Pa /etc/mygate 94Default gateway address(es). 95.El 96.Sh SEE ALSO 97.Xr hostname 1 , 98.Xr hostname.if 5 , 99.Xr hosts 5 , 100.Xr resolv.conf 5 , 101.Xr hostname 7 , 102.Xr netstart 8 , 103.Xr route 8 104.Sh HISTORY 105This manual page first appeared in 106.Ox 3.4 . 107