Ask Your Question
0

"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
host-192-168-102-6.ant.uni-bremen.de

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)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.102.3
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 127.0.0.1/8 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 192.168.102.6/24 brd 192.168.102.255 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 0.0.0.0         UG    0      0        0 eth0
192.168.102.0   *               255.255.255.0   U     0      0        0 eth0
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

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

You don't have records in /etc/hosts

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

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

Seen: 565 times

Last updated: Sep 01 '15