"hostname -f" fails, while "hostname -A" works

asked 2015-09-01 15:27:01 -0500

hennichodernich gravatar image

Hi all,

I'm running Icehouse on Ubuntu 12.04 hosts with an Ubuntu 14.04 "cloud image" instance.

I have the problem, that within the VM "hostname -f" fails, while "hostname -A" works:

root@antcloud1:~# hostname -f
hostname: Name or service not known
root@antcloud1:~# hostname -A

dhcp_domain is set to ant.uni-bremen.de (as you can see), /etc/resolv.conf reads

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
search ant.uni-bremen.de

and /etc/nsswitch.conf:

# /etc/nsswitch.conf
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         files ldap
group:          files ldap
#shadow:         compat

hosts:          files dns
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis

automount:      ldap

/etc/hosts only contains the localhost entry, and /etc/host.conf reads

# The "order" line is only used by old versions of the C library.
order hosts,bind
multi on

DNS seems to work properly, but the inability to determine the FQDN inhibits the start of certain daemons within the VM. Can anyone of you give me a hint into the correct direction? Do I need to automatically generate the hosts file using cloud-init?

best regards Henning

Edit: add IP and route information:

root@antcloud1:~# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether fa:16:3e:dd:9d:f9 brd ff:ff:ff:ff:ff:ff
    inet brd scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::f816:3eff:fedd:9df9/64 scope link 
       valid_lft forever preferred_lft forever
root@antcloud1:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         host-192-168-10         UG    0      0        0 eth0   *        U     0      0        0 eth0
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-09-30 10:08:47 -0500

You don't have records in /etc/hosts

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2015-09-01 15:25:05 -0500

Seen: 606 times

Last updated: Sep 01 '15