Re: dhcp address in /etc/hosts

2013-07-21 Thread Alexey E. Suslikov
Kenneth R Westerback  rogers.com> writes:

> > I don't really get a vote as i'm not a developer, however cookies to anyone
> > who fixes this the correct way.
> > 
> > -- 
> > 
> > Sam Fourman Jr.
> > 
> 
> Define 'correct way'. 

Personally, I have found running BIND and placing 127.0.0.1 to
/etc/resolv.conf as most easier way to minimize /etc/hosts usage.

I always thought of very minimalistic (read "secure") DNS server
built-in into dhclient as a privsep process, so dhclient can 
dynamically push settings (based on a lease from DHCP server) via
IMSG, so placing 127.0.0.1 to /etc/resolv.conf will "just work".

I understand above approach maybe mixing things in non-unix way,
but DHCP is designed so: it touches interface address, default
gateway and resolver settings.



Re: dhcp address in /etc/hosts

2013-07-21 Thread Alexander Hall

On 07/21/13 09:24, Alexander Hall wrote:


Since we by default allow dhclient to rewrite (and thus a dhcp server to
dictate) our hostname, I'm wondering if a 'lookup hostname file bind' in
resolv.conf could be useful... But I expect being flamed for it. :-)


Thinking of it, what address would it use? egress:0? I dunno.

/Alexander



Re: dhcp address in /etc/hosts

2013-07-21 Thread Alexander Hall

On 07/21/13 09:02, Jan Stary wrote:

On Jul 20 18:34:50, dera...@cvs.openbsd.org wrote:

On Jul 20 22:14:52, h...@stare.cz wrote:

I believe I have bitched about this before,
but I have come to it again with new install.

If I use [dhcp] to configure an interface during an install,
the ephemeral DHCP-assigned address gets written into /etc/hosts.

That address is meaningless after the reboot, possibly even
conflicting when I later decide on a fixed IP for the machine.

Should it be removed from /etc/hosts after the install,
when we have DNS set up and all? Should it at least
be mentioned in afterboot(8)?



--- afterboot.8.origSat Jul 20 22:24:03 2013
+++ afterboot.8 Sat Jul 20 22:28:51 2013
@@ -153,6 +153,13 @@ if it needs to be changed.
  You will also need to edit the
  .Pa /etc/myname
  file to have it stick around for the next reboot.
+.Pp
+Note that the hostname chosen during installation is saved in
+.Pa /etc/hosts
+with whatever address was used then.
+If you later decide on another address for the machine,
+remember to remove the conflicting one from
+.Pa /etc/hosts .
  .Ss Verify network interface configuration
  The first thing to do is an
  .Ic ifconfig -a



I don't like this diff.

But perhaps because I totally hate that the installer is placing that
name there.  I believe that dynamically learned names should not be
saved in that fashion.


I don't like it either;
what is the reason we are saving it there?

I vaguely remember sendmail bitching about
not being able to resolve its own hostname
- is it that?



Since we by default allow dhclient to rewrite (and thus a dhcp server to 
dictate) our hostname, I'm wondering if a 'lookup hostname file bind' in 
resolv.conf could be useful... But I expect being flamed for it. :-)


/Alexander



Re: dhcp address in /etc/hosts

2013-07-21 Thread Jan Stary
On Jul 20 18:34:50, dera...@cvs.openbsd.org wrote:
> > On Jul 20 22:14:52, h...@stare.cz wrote:
> > > I believe I have bitched about this before,
> > > but I have come to it again with new install.
> > > 
> > > If I use [dhcp] to configure an interface during an install,
> > > the ephemeral DHCP-assigned address gets written into /etc/hosts.
> > > 
> > > That address is meaningless after the reboot, possibly even
> > > conflicting when I later decide on a fixed IP for the machine.
> > > 
> > > Should it be removed from /etc/hosts after the install,
> > > when we have DNS set up and all? Should it at least
> > > be mentioned in afterboot(8)?
> > 
> > 
> > --- afterboot.8.origSat Jul 20 22:24:03 2013
> > +++ afterboot.8 Sat Jul 20 22:28:51 2013
> > @@ -153,6 +153,13 @@ if it needs to be changed.
> >  You will also need to edit the
> >  .Pa /etc/myname
> >  file to have it stick around for the next reboot.
> > +.Pp
> > +Note that the hostname chosen during installation is saved in
> > +.Pa /etc/hosts
> > +with whatever address was used then.
> > +If you later decide on another address for the machine,
> > +remember to remove the conflicting one from
> > +.Pa /etc/hosts .
> >  .Ss Verify network interface configuration
> >  The first thing to do is an
> >  .Ic ifconfig -a
> > 
> 
> I don't like this diff.
> 
> But perhaps because I totally hate that the installer is placing that
> name there.  I believe that dynamically learned names should not be
> saved in that fashion.

I don't like it either;
what is the reason we are saving it there?

I vaguely remember sendmail bitching about
not being able to resolve its own hostname
- is it that?



Re: dhcp address in /etc/hosts

2013-07-20 Thread Kenneth R Westerback
On Sat, Jul 20, 2013 at 08:42:21PM -0400, Sam Fourman Jr. wrote:
> I don't like this diff.
> 
> >
> > But perhaps because I totally hate that the installer is placing that
> > name there.  I believe that dynamically learned names should not be
> > saved in that fashion.
> >
> >
> 
> I don't really get a vote as i'm not a developer, however cookies to anyone
> who fixes this the correct way.
> 
> -- 
> 
> Sam Fourman Jr.
> 

Define 'correct way'. :-)

 Ken



Re: dhcp address in /etc/hosts

2013-07-20 Thread Sam Fourman Jr.
I don't like this diff.

>
> But perhaps because I totally hate that the installer is placing that
> name there.  I believe that dynamically learned names should not be
> saved in that fashion.
>
>

I don't really get a vote as i'm not a developer, however cookies to anyone
who fixes this the correct way.

-- 

Sam Fourman Jr.



Re: dhcp address in /etc/hosts

2013-07-20 Thread Theo de Raadt
> On Jul 20 22:14:52, h...@stare.cz wrote:
> > I believe I have bitched about this before,
> > but I have come to it again with new install.
> > 
> > If I use [dhcp] to configure an interface during an install,
> > the ephemeral DHCP-assigned address gets written into /etc/hosts.
> > 
> > That address is meaningless after the reboot, possibly even
> > conflicting when I later decide on a fixed IP for the machine.
> > 
> > Should it be removed from /etc/hosts after the install,
> > when we have DNS set up and all? Should it at least
> > be mentioned in afterboot(8)?
> 
> 
> --- afterboot.8.orig  Sat Jul 20 22:24:03 2013
> +++ afterboot.8   Sat Jul 20 22:28:51 2013
> @@ -153,6 +153,13 @@ if it needs to be changed.
>  You will also need to edit the
>  .Pa /etc/myname
>  file to have it stick around for the next reboot.
> +.Pp
> +Note that the hostname chosen during installation is saved in
> +.Pa /etc/hosts
> +with whatever address was used then.
> +If you later decide on another address for the machine,
> +remember to remove the conflicting one from
> +.Pa /etc/hosts .
>  .Ss Verify network interface configuration
>  The first thing to do is an
>  .Ic ifconfig -a
> 

I don't like this diff.

But perhaps because I totally hate that the installer is placing that
name there.  I believe that dynamically learned names should not be
saved in that fashion.



Re: dhcp address in /etc/hosts

2013-07-20 Thread Jan Stary
On Jul 20 22:14:52, h...@stare.cz wrote:
> I believe I have bitched about this before,
> but I have come to it again with new install.
> 
> If I use [dhcp] to configure an interface during an install,
> the ephemeral DHCP-assigned address gets written into /etc/hosts.
> 
> That address is meaningless after the reboot, possibly even
> conflicting when I later decide on a fixed IP for the machine.
> 
> Should it be removed from /etc/hosts after the install,
> when we have DNS set up and all? Should it at least
> be mentioned in afterboot(8)?


--- afterboot.8.origSat Jul 20 22:24:03 2013
+++ afterboot.8 Sat Jul 20 22:28:51 2013
@@ -153,6 +153,13 @@ if it needs to be changed.
 You will also need to edit the
 .Pa /etc/myname
 file to have it stick around for the next reboot.
+.Pp
+Note that the hostname chosen during installation is saved in
+.Pa /etc/hosts
+with whatever address was used then.
+If you later decide on another address for the machine,
+remember to remove the conflicting one from
+.Pa /etc/hosts .
 .Ss Verify network interface configuration
 The first thing to do is an
 .Ic ifconfig -a



dhcp address in /etc/hosts

2013-07-20 Thread Jan Stary
I believe I have bitched about this before,
but I have come to it again with new install.

If I use [dhcp] to configure an interface during an install,
the ephemeral DHCP-assigned address gets written into /etc/hosts.

That address is meaningless after the reboot, possibly even
conflicting when I later decide on a fixed IP for the machine.

Should it be removed from /etc/hosts after the install,
when we have DNS set up and all? Should it at least
be mentioned in afterboot(8)?

Jan