Hostname not respecting search domain
Tom H
tomh0665 at gmail.com
Fri Aug 7 22:12:04 UTC 2015
On Thu, Aug 6, 2015 at 5:06 PM, Andrew Langhorn <andrew at ajlanghorn.com> wrote:
>
> I have a machine running Trusty. I would have expected the output of
> `hostname -f` to respond with the hostname of the machine, followed by the
> search domain as set in /etc/network/interfaces or /etc/resolv.conf. For
> instance, if my search domain was set to `ajlanghorn.com`, and my hostname
> was `test01`, `hostname -f` should respond with `test01.ajlanghorn.com`.
>
> Assuming I've not got any of the above wrong, I have a weird issue with the
> `hostname` command. Regardless of which flag I pass it - be that `s`, `f` or
> no flag at all - I always get the same response from `hostname` back, which
> is to give `test01` as the response.
>
> There is a search domain set in `/etc/network/interfaces` and I've given one
> to `/etc/resolv.conf` using resolvconf, specifying the correct network
> interface.
This isn't how "search ..." works.
If you want "hostname -f" to return the fqdn, you have to have that
fqdn supplied via "/etc/hosts" or a dns service.
More information about the ubuntu-users
mailing list