Mailinglist Archive: opensuse (1477 mails)

< Previous Next >
Re: [opensuse] what does 127.0.1.1 mean?
lynn said the following on 03/29/2012 01:34 PM:
12.1

Well it will depend on whether you are running systemd or sysvinit
... sort of


Hi
We have a bind nameserver for our 192 domain.

And you have reverse lookup as well so that the FQDN of the machine
based on its 192.whatever IP address can be determined?


For a non static IP client I have to set the line:
127.0.1.1 hostname.domain hostname
in /etc/hosts

It really should be
127.0.0.1 localhost.localdomain localhost
which makes me think you have an error in you DNS config.

Do you have an entry in named.conf something like

zone "0.0.127.in-addr.arpa" IN {
type master;
file "reverse/named.localdomain";
allow-update { none; };
};

::::::::::::
reverse/named.localdomain
::::::::::::
$TTL 86400
@ IN SOA localhost. root.localhost. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS localhost.
1 IN PTR localhost.


and a corresponding forward?

zone "localdomain" IN {
type master;
file "master/localdomain.zone";
allow-update { none; };
};


::::::::::::::
master/localdomain.zone
::::::::::::::
$TTL 86400
@ IN SOA localhost root (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS localhost
localhost IN A 127.0.0.1




otherwise hostname -f and lots of other stuff doesn't work.

1. Why?
2. What should the file /etc/HOSTNAME contain?

I don't use that, but perhaps you're thinking of "hostname -F ..." as in

-F, --file filename
Read the host name from the specified file. Comments (lines starting
with a ‘#') are ignored.

The manual says of "-f"
-f, --fqdn, --long
Display the FQDN (Fully Qualified Domain Name). A FQDN consists of a
short host name and the DNS
domain name. Unless you are using bind or NIS for host lookups you
can change the FQDN and the DNS
domain name (which is part of the FQDN) in the /etc/hosts file.

I'm sure that if you do a strace you'll find that the hostname command
tries using DNS first. The issue is does it try "0.0.0.0" or does it
try the ip address on Eth0 ?

So take a look at boot scripts and see which it uses.
Maybe it syslogs ....? Maybe it does a reverse lookup on /etc hosts and
plonks whatever it finds into /etc/HOSTNAME.

Maybe your problem is that its doing this before DHCP has assigned the
192. address and its using 127.0.0.1 instead ... perhaps because you're
doing a boot in parallel and this should be a sync point.

I haven't looked at how this works in systemd.


I'll admit that I have a central control view of things.
I've set up my DHCP/DNS so that it does it as "Oh, that's you MAC
address, well on *that* subnet, this is your IP address and this is your
name".
None of this nonsense about the host telling the DHCP server what name
it wants and what subnet it wants to be on ... Only static hosts (aka
servers) have that right ... well not really, they don't use DHCP :-)
If you're a visitor with an unrecognised address you get sandboxed.
If you try spoofing a MAC address .... lets not talk about that, I don't
want to give people ideas ...

Yes, there are other ways to do it all, but this one works.

--
"Conviction is worthless unless it is converted into conduct."
-- Thomas Carlyle.
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups
References