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

Re: set domain name in Debian `



On Fri, Nov 11, 2016 at 01:27:28PM -0700, Glenn English wrote:
> This seems to be a common question -- it's all over the 'Net. 
> 
> I have to change the domain name of a Jessie server I'm working on. How do you do it? (Aside from putting the FQDN in /etc/hostname, which kinda works.)

That depends on what you mean.

Normally the only time a domain name is used is when you look up a
hostname in DNS but you don't specify the fully qualified name.  Like,
if you're on your corporate LAN and you type "ping server7", your system
is probably configured so that it knows to look up "server7.example.com"
or whatever is appropriate for your organization.

That usage of the concept of "domain name" is defined by the "search"
lines in /etc/resolv.conf.  If your corporate environment is set up for
it, then you probably get these lines added to your resolv.conf by DHCP
and you don't have to do anything at all.

If your resolv.conf doesn't get the default search domain that you want,
then you can edit /etc/dhcp/dhclient.conf to fix things.

Now, on the other hand, you might mean something like "I am setting up
a web server on the Internet and I want people to be able to get to it
under such-and-such a name."  Then it's an ENTIRELY different question
and it has nothing at all to do with your /etc/hosts or /etc/resolv.conf
files.  It has to do with domain name registrars and DNS configuration,
and then (probably) with web server virtual host configuration.
What you see when you type "hostname" is COMPLETELY IRRELEVANT.

There's another variant of this question that involves email server
configuration, but I consider this the least likely interpretation.

Then, there's a concept of domain names in NIS, and probably in Kerberos,
and probably in LDAP, though of those things I only know NIS.

So... what are you actually trying to do?  Be very specific.


Reply to: