set FQDN for hostname
Luis Paulo
luis.barbas at gmail.com
Fri Nov 12 03:18:37 UTC 2010
On Sun, Nov 7, 2010 at 00:43, Luis Paulo <luis.barbas at gmail.com> wrote:
> On Sat, Nov 6, 2010 at 23:41, Tom H <tomh0665 at gmail.com> wrote:
>> On Sat, Nov 6, 2010 at 12:58 PM, Luis Paulo <luis.barbas at gmail.com> wrote:
>>> On Sat, Nov 6, 2010 at 10:29, Tom H <tomh0665 at gmail.com> wrote:
>>>>
>>>> <snip>
>>>>
>>>> If "cat /etc/hostname" returns "thufir.hawat", "hostname" and
>>>> "hostname --long" will return "thufir.hawat", "hostname --short" will
>>>> return "thufir", and "hostname --domain" will return "hawat".
>>>
>>> ...
>>> The /etc/hostname should only contain the hostname (not the domain part)
>>>...
>>
>> I mentioned both scenarios (short and long name in "/etc/hostname")
>> because this choice is just as divisive as vi/emacs, gnome/kde,
>> sendmail/postfix/exim, ... It is as much as a religious belief as it
>> is a canonical way of setting up a box.
>>
>
> Oh, sorry Tom, I was more trying to complement to the OP than to
> contradict you. I see what you mean.
>
> A few years ago, I remember hostname (with -f, I guess) returning
> something like desktop.example.com.example.com (I was using a local
> dns, pretty sure)
> Also I was still new to linux and very new to having a local
> dns/dhcpd, so I don't know if I will be able to reproduce it, but I
> may try.
>
> That's why I made a note to myself to just use the host name on
> /etc/hostname. Not really sure if that was the problem, now that you
> have mentioned it.
>
> Right now, I change /etc/hostname to desktop.example.com
> $ hostname --long
> hostname: Name or service not know # same thing it did with just
> desktop on /etc/hostname
>
> and
> $ hostname -A
> desktop.<correct dns domain> # not example.com
>
> I'll reboot and check again (and bind is not yet really configured
> since I changed to lucid)
>
> Thanks
> Luis
>
Just to not leaving this hanging... Nothing new to see here, keep walking :)
After setting dhcp/bind correctly and changing /etc/hostname from
desktop to desktop.example.com
$ hostname
desktop
$ hostname --long
desktop.<correct dns domain>
$ hostname --domain
<correct dns domain>
$ hostname -A
desktop.local
I have
$ cat /etc/nsswitch.conf
hosts: dns files ...
Nothing on hosts, except
127.0.0.1 localhost
I couldn't reproduce hostname returning anything similar to
desktop.example.com.example.com, I'll give it a rest :)
So the only really strange thing is
$ hostname -A
desktop.local
(same with just desktop in /etc/hostname) but I'll worry about it when
I have the time.
$ uname -a
Linux desktop.enove.com.pt 2.6.35-22-server #35-Ubuntu SMP Sat Oct 16
22:02:33 UTC 2010 x86_64 GNU/Linux
Best regards
Luis
More information about the ubuntu-users
mailing list