[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Got a machine name problem



On Wednesday 24 February 2021 08:44:06 Greg Wooledge wrote:

> Gene Heskett (gheskett@shentel.net) wrote:
> > But wtf? I have edited "sudo nano" /etc/domainname, did not set the
> > i bit, and the edit is still there, but asking for it is (none)
>
> There is no such file on my system.  What made you think that you
> should create this file?  What program did you think would use it?
>
> > domainname domain.name changes it only for this boot, a reboot
> > clears it to (none) again.
>
>        domainname - show or set the system's NIS/YP domain name
>
> Are you using NIS?  If you are, you should be configuring the NIS
> domain name in the file /etc/defaultdomain (which is read by
> /etc/init.d/nis which is what the systemd unit points to, because
> apparently Debian's NIS packaging is not fully updated for systemd).
>
> But I think you're actually just confused, and you aren't using NIS,
> but somehow you've started poking around at various pieces of NIS
> without realizing it.  And you've also mixed up command names and
> filenames.
>
> > So I must have screwed something up with that edit, but how do I fix
> > it?
>
> What *exactly* are you trying to do?
>
> Are you trying to set your default DNS domain name, which is used to
> search for fully qualified hostnames when you only type partial
> hostnames?
>
> E.g. let's pretend you work for a company named Neener and they use
> the domain name neener.com for their internal hosts.  You're at your
> desk in the Neener HQ, and you're using a Unix workstation that
> they've set up for you.  It has the hostname "ws43", or
> "ws43.neener.com".
>
> Now, you want to ssh into your coworker's workstation, which has the
> hostname "ws31", or "ws31.neener.com".
>
> Since it isn't the 1980s, your workplace has set up a DNS
> infrastructure that lets you obtain the IP address of ws31.neener.com
> (and all the other workstations, servers, and so on).  So, if you were
> to type
> "ssh ws31.neener.com", that would work.  You'd get the IP address of
> ws31.neener.com from DNS, and you'd connect to the correct
> workstation.
>
> But that's a lot of typing.  So your workplace has also arranged
> things so that you can simply type "ssh ws31", and that will also
> work.
>
> How does that work?

By looking its alias up in /etc/hosts.

> In the file /etc/resolv.conf there are several different kinds of
> lines that may be present.  One of them is the "search" line.
2 lines in that real file.

search coyote.den
dnsserver ipv4 address

which is the local domain name. And that does show up in the 
dnsdomainname report. That just started working but I've no clue why.

> If the resolv.conf file contains the line "search neener.com", this
> means any hostname that you try to resolve which doesn't contain a dot
> will get ".neener.com" appended to it.  So, when you try to resolve
> "ws31", the DNS resolver library will automatically try
> "ws31.neener.com" for you.
>
> So, the next question is, "How can I put the line search neener.com
> into my /etc/resolv.conf file?"  In a sane, sensible universe, it
> would be easy -- you would just edit the file with a text editor, and
> that would be the end of it.
>
> But we do not live in that universe.
>
It hasn't existed since Pottering came on the scene...
So its not a mystery link to something resolveconf might conjure up, and 
if it gets changed, NM is famous for that, so it gets restored and a +i 
applied.

> The /etc/resolv.conf file is continually, automatically rewritten by a
> plethora of programs that all think they know what you want.  They're
> all wrong, of course, but you can't make the developers understand
> that. Your changes to the /etc/resolv.conf file will be overwritten,
> probably within an hour.
>
> At this point, please read <https://wiki.debian.org/resolv.conf> to
> see what your options are, for making permanent changes to
> resolv.conf.  It's really stupidly complicated, and there's no point
> in my repeating it all here.
>
I just read it, Stupid is not an adequate description.

> THAT is how you set your default DNS domain name, and THAT is what it
> means to have a default DNS domain name in the first place.  It's not
> about your own hostname.  It's about shortening what you have to type
> when you resolve *other* hostnames within your organization's
> namespace.

Well, its now working. If I suddenly develop a bad case of the 
169.it.is.flu in my routing table, synaptic won't let me remove avahi or 
nm without totally destroying the system, but nothing complains if I 
nuke the binaries.

avahi and nm may be solutions a lappy user might need. Damned little is 
portable here without a multi-ton gantry crane. They are both just 
problems waiting to bite me, and to be emasculated by whatever means it 
takes.

My network was built by me, nothing portable about it, and I don't 
understand why a dirt simple, static, /etc/hosts based local network, is 
so damned hard to actually make work. It doesn't need a dns server other 
than using the router as a relay to my isp's server, or anything 
associated with dhcp, and I don't really appreciate haveing all this 
laptop crap forcibly installed when it does nothing for me but screw 
things up. Funny thing happens when its all running my way, I can go to 
any machine on my local net, fire up firefox and go visit any site on 
the planet as long as my isp's dns server can look it up. It all just 
works without all the lappy BS. Sure FF is a little slow on the rpi4b, 
but it still works 100%.  That rpi4b is running an 80 yo medium sized 11 
by 54 inch Sheldon metal lathe, that weighs 3/4 ton, at speeds no 
machinist can match doing it by hand. Portable its not.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/gene>


Reply to: