brainchild
Anmeldungsdatum: 1. Dezember 2007
Beiträge: Zähle...
|
Hallo, mal wieder ein kleineres Problem mit meinem Server. Da ich von OpenWRT auf Speedport wechseln musste, habe ich versucht mich um eine vernünftige Namesauflösung im Netz zu kümmern. Kurz und knapp. Ich habe dnsmasq installiert und konfiguriert. Bei den Clients im Netz ist auch alles absolut schick, nur am Server selber kommt nur Müll raus. 1
2
3
4
5
6
7
8
9
10
11
12
13 | # dhcp range
dhcp-range=192.168.2.150,192.168.2.250,1h
# domain
domain=tropho.bie
# default gw
dhcp-option=3,192.168.2.1
# default dns
dhcp-option=6,192.168.2.10
# restricted dns
dhcp-option=tag:opendns,option:dns-server,208.67.222.222,208.67.220.220
# restricted clients
dhcp-host=84:63:d6:39:4e:f0,handy-jenny,192.168.2.50,1h,set:opendns
dhcp-host=10:ae:60:c0:d9:23,kindle-jenny,192.168.2.51,1h,set:opendns
|
Test vom Macbook Air zeigt, das alles geht.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 | ksc@klaus ~ % nslookup htpc :(
Server: 192.168.2.10
Address: 192.168.2.10#53
Name: htpc.tropho.bie
Address: 192.168.2.30
ksc@klaus ~ % nslookup web.de
Server: 192.168.2.10
Address: 192.168.2.10#53
Non-authoritative answer:
Name: web.de
Address: 212.227.222.8
Name: web.de
Address: 212.227.222.9
|
Wenn ich jetzt aber am Server, dort wo auch dnsmasq läuft, versuche eine vernünftige Namesauflösung hinzu bekommen ... 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 | root@bruno ~ # nslookup htpc │
Server: 192.168.2.1 │
Address: 192.168.2.1#53 │
│
Non-authoritative answer: │
Name: htpc.tropho.bie │
Address: 62.157.140.133 │
Name: htpc.tropho.bie │
Address: 80.156.86.78 │
│
root@bruno ~ # nslookup localhost │
Server: 192.168.2.1 │
Address: 192.168.2.1#53 │
│
Non-authoritative answer: │
Name: localhost.tropho.bie │
Address: 80.156.86.78 │
Name: localhost.tropho.bie │
Address: 62.157.140.133 │
│
root@bruno ~ # cat /etc/resolv.conf │
# 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 127.0.0.1 │
nameserver 192.168.2.1 │
search tropho.bie
|
Ich verstehe es ehrlich nicht :-/
|
lubux
Anmeldungsdatum: 21. November 2012
Beiträge: 13922
|
brainchild schrieb: ksc@klaus ~ % nslookup web.de
Server: 192.168.2.10
Address: 192.168.2.10#53
Non-authoritative answer:
Name: web.de
Address: 212.227.222.8
Name: web.de
Address: 212.227.222.9 root@bruno ~ # nslookup htpc │
Server: 192.168.2.1 │
Address: 192.168.2.1#53 │
│
Non-authoritative answer: │
Name: htpc.tropho.bie │
Address: 62.157.140.133 │
Name: htpc.tropho.bie │
Address: 80.156.86.78 │
│
│
root@bruno ~ # cat /etc/resolv.conf │
# 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 127.0.0.1 │
nameserver 192.168.2.1
search tropho.bie
Wie unterscheiden sich die Server von 192.168.2.1 und 192.168.2.10?
|
brainchild
(Themenstarter)
Anmeldungsdatum: 1. Dezember 2007
Beiträge: 17
|
192.168.2.10 ist der dnsmasq-Server, 192.168.2.1 ist der Forwader, sprich der DNS-Server auf dem Speedport. Hab mich auch gerade gewundert, warum er nicht loopback abfragt, sondern gleich den forwarder. Festgestellt hab ich, das das lo offensichtlich keine IP-Adresse hat? | root@bruno ~ # LC_ALL=C ifconfig lo │
lo Link encap:Local Loopback │
LOOPBACK MTU:65536 Metric:1 │
RX packets:0 errors:0 dropped:0 overruns:0 frame:0 │
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 │
collisions:0 txqueuelen:0 │
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
|
/etc/network/interfaces schaut doch aber normal aus. 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 | root@bruno ~ # cat /etc/network/interfaces │
# This file describes the network interfaces available on your system │
# and how to activate them. For more information, see interfaces(5). │
│
# The loopback network interface │
auto lo │
iface lo inet loopback │
│
# The primary network interface │
# auto eth0 │
# iface eth0 inet dhcp │
│
auto br0 │
iface br0 inet static │
address 192.168.2.10 │
netmask 255.255.255.0 │
gateway 192.168.2.1 │
dns-nameservers 127.0.0.1 192.168.2.1 │
dns-search tropho.bie │
bridge_ports eth0
|
|
lubux
Anmeldungsdatum: 21. November 2012
Beiträge: 13922
|
brainchild schrieb: 192.168.2.10 ist der dnsmasq-Server, 192.168.2.1 ist der Forwader, sprich der DNS-Server auf dem Speedport. Hab mich auch gerade gewundert, warum er nicht loopback abfragt, sondern gleich den forwarder. Festgestellt hab ich, das das lo offensichtlich keine IP-Adresse hat? /etc/network/interfaces schaut doch aber normal aus. │
auto br0 │
iface br0 inet static │
address 192.168.2.10
netmask 255.255.255.0 │
gateway 192.168.2.1 │
dns-nameservers 127.0.0.1 192.168.2.1 │
dns-search tropho.bie │
bridge_ports eth0
OK, 127.0.0.1 gibt es nicht und wenn Du auf 192.168.2.10 die 192.168.2.1 als DNS-Server konfiguriert hast, dann wird diese auch benutzt.
|
brainchild
(Themenstarter)
Anmeldungsdatum: 1. Dezember 2007
Beiträge: 17
|
ok, gibts also zwei Probleme. Warum hat das Loopback-Interface keine Adresse nach reboot und warum funktioniert die Namesauflösung trotz, das ich dem Interface nun eine Adresse vergeben habe, nicht. | root@bruno ~ # ifconfig lo 127.0.0.1
root@bruno ~ # ifconfig lo
lo Link encap:Lokale Schleife
inet Adresse:127.0.0.1 Maske:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metrik:1
RX-Pakete:86 Fehler:0 Verloren:0 Überläufe:0 Fenster:0
TX-Pakete:86 Fehler:0 Verloren:0 Überläufe:0 Träger:0
Kollisionen:0 Sendewarteschlangenlänge:0
RX-Bytes:22326 (22.3 KB) TX-Bytes:22326 (22.3 KB)
root@bruno ~ #
|
| root@bruno ~ # nslookup localhost
Server: 127.0.0.1
Address: 127.0.0.1#53
Non-authoritative answer:
Name: localhost.tropho.bie
Address: 62.157.140.133
Name: localhost.tropho.bie
Address: 80.156.86.78
|
|
lubux
Anmeldungsdatum: 21. November 2012
Beiträge: 13922
|
brainchild schrieb: .. warum funktioniert die Namesauflösung trotz, das ich dem Interface nun eine Adresse vergeben habe, nicht.
Wie ist die Ausgabe von:
ping -c 2 localhost
?
|
brainchild
(Themenstarter)
Anmeldungsdatum: 1. Dezember 2007
Beiträge: 17
|
| root@bruno ~ # ping -c 2 localhost
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.077 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.065 ms
--- localhost ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.065/0.071/0.077/0.006 ms
root@bruno ~ #
|
macht hier nslookup Müll?
| root@bruno ~ # nslookup localhost
Server: 127.0.0.1
Address: 127.0.0.1#53
Non-authoritative answer:
Name: localhost.tropho.bie
Address: 80.156.86.78
Name: localhost.tropho.bie
Address: 62.157.140.133
|
via dig schauts besser aus! 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 | root@bruno ~ # dig @localhost localhost
; <<>> DiG 9.9.5-3ubuntu0.1-Ubuntu <<>> @localhost localhost
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57596
;; flags: qr aa rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;localhost. IN A
;; ANSWER SECTION:
localhost. 0 IN A 127.0.0.1
;; Query time: 2 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sat Jan 31 14:48:25 CET 2015
;; MSG SIZE rcvd: 43
|
|
lubux
Anmeldungsdatum: 21. November 2012
Beiträge: 13922
|
brainchild schrieb: | root@bruno ~ # ping -c 2 localhost
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.077 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.065 ms
--- localhost ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.065/0.071/0.077/0.006 ms
root@bruno ~ #
|
macht hier nslookup Müll?
Sieht so aus. Lösch mal alle dns-Caches (System, dnsmasq ...) und schau danach mit tcpdump nach, von wo nslookup in Zusammenarbeit mit deinem dnsmasq, diese Namensauflösung bekommt:
root@bruno ~ # nslookup localhost
Server: 127.0.0.1
Address: 127.0.0.1#53
Non-authoritative answer:
Name: localhost.tropho.bie
Address: 80.156.86.78
Name: localhost.tropho.bie
Address: 62.157.140.133
dnsmasq benutzt die /etc/hosts in der Regel nicht, aber dig hat ja auch dein dnsmasq benutzt. Wie ist die Ausgabe von:
cat /etc/hosts
?
Hast Du evtl. zusätzliche/andere hosts-Datei(en) (oder gleichwertig) für deinen dnsmasq konfiguriert?
|
brainchild
(Themenstarter)
Anmeldungsdatum: 1. Dezember 2007
Beiträge: 17
|
Also /etc/hosts wird von dnsmasq benutzt. | Jan 31 09:29:28 bruno dnsmasq[1085]: lese /var/run/dnsmasq/resolv.conf
Jan 31 09:29:28 bruno dnsmasq[1085]: Benutze Namensserver 192.168.2.1#53
Jan 31 09:29:28 bruno dnsmasq[1085]: Benutze Namensserver 127.0.0.1#53
Jan 31 09:29:28 bruno dnsmasq[1085]: /etc/hosts gelesen - 17 Adressen
|
| root@bruno ~ # cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 bruno
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
### Einträge für DNSMASQ ###
[ ... ]
|
Also mittlerweile denke ich, das es nur an der fehlenden IP-Adresse auf dem Looback-Interface lag. Warum dort beim reboot aber keine konfiguriert wird ist mir weiter unklar. Als Workaround habe ich jetzt die /etc/network/interfaces angepasst: 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 | root@bruno ~ # cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
address 127.0.0.1
netmask 255.0.0.0
# The primary network interface
# auto eth0
# iface eth0 inet dhcp
auto br0
iface br0 inet static
address 192.168.2.10
netmask 255.255.255.0
gateway 192.168.2.1
dns-nameservers 127.0.0.1 192.168.2.1
dns-search tropho.bie
bridge_ports eth0
|
|
lubux
Anmeldungsdatum: 21. November 2012
Beiträge: 13922
|
brainchild schrieb: Also /etc/hosts wird von dnsmasq benutzt. Also mittlerweile denke ich, das es nur an der fehlenden IP-Adresse auf dem Looback-Interface lag. Warum dort beim reboot aber keine konfiguriert wird ist mir weiter unklar. Als Workaround habe ich jetzt die /etc/network/interfaces angepasst:
Kannst Du mit nslookup (und dnsmasq/hosts-Datei), localhost jetzt richtig auflösen?
nslookup localhost
|
brainchild
(Themenstarter)
Anmeldungsdatum: 1. Dezember 2007
Beiträge: 17
|
das klappt noch immer nicht. | root@bruno ~ # nslookup localhost
Server: 127.0.0.1
Address: 127.0.0.1#53
Non-authoritative answer:
Name: localhost.tropho.bie
Address: 62.157.140.133
Name: localhost.tropho.bie
Address: 80.156.86.78
|
Hab heute früh einen weiteren reboot durchgeführt, und trotz, das ich in /etc/network/interfaces auch das loopback konfiguriert habe, bekommt es nach reboot keine IP-Adresse :/
|
lubux
Anmeldungsdatum: 21. November 2012
Beiträge: 13922
|
brainchild schrieb: ... auch das loopback konfiguriert habe, bekommt es nach reboot keine IP-Adresse :/
Wie sind die Ausgaben von:
ip a
ifconfig -a
cat /var/log/syslog | grep -i 127.0.0.1
sudo netstat -tulpen | grep -i 127.0.0.1
?
|
brainchild
(Themenstarter)
Anmeldungsdatum: 1. Dezember 2007
Beiträge: 17
|
| root@bruno ~ # ip a :(
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP group default qlen 1000
link/ether 00:26:2d:01:8b:7b brd ff:ff:ff:ff:ff:ff
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 00:26:2d:01:8b:7b brd ff:ff:ff:ff:ff:ff
inet 192.168.2.10/24 brd 192.168.2.255 scope global br0
valid_lft forever preferred_lft forever
root@bruno ~ #
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 | root@bruno ~ # ifconfig -a
br0 Link encap:Ethernet Hardware Adresse 00:26:2d:01:8b:7b
inet Adresse:192.168.2.10 Bcast:192.168.2.255 Maske:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metrik:1
RX-Pakete:357 Fehler:0 Verloren:0 Überläufe:0 Fenster:0
TX-Pakete:282 Fehler:0 Verloren:0 Überläufe:0 Träger:0
Kollisionen:0 Sendewarteschlangenlänge:0
RX-Bytes:31503 (31.5 KB) TX-Bytes:70839 (70.8 KB)
eth0 Link encap:Ethernet Hardware Adresse 00:26:2d:01:8b:7b
UP BROADCAST RUNNING MULTICAST MTU:1500 Metrik:1
RX-Pakete:359 Fehler:0 Verloren:0 Überläufe:0 Fenster:0
TX-Pakete:282 Fehler:0 Verloren:0 Überläufe:0 Träger:0
Kollisionen:0 Sendewarteschlangenlänge:1000
RX-Bytes:37551 (37.5 KB) TX-Bytes:70839 (70.8 KB)
Interrupt:16
lo Link encap:Lokale Schleife
LOOPBACK MTU:65536 Metrik:1
RX-Pakete:0 Fehler:0 Verloren:0 Überläufe:0 Fenster:0
TX-Pakete:0 Fehler:0 Verloren:0 Überläufe:0 Träger:0
Kollisionen:0 Sendewarteschlangenlänge:0
RX-Bytes:0 (0.0 B) TX-Bytes:0 (0.0 B)
|
| root@bruno ~ # grep 127.0.0.1 /var/log/syslog
Feb 2 10:44:51 bruno dnsmasq[1109]: Benutze Namensserver 127.0.0.1#53
|
| root@bruno ~ # netstat -tulpen | grep -i 127.0.0.1 :(
1 root@bruno ~ #
|
|
lubux
Anmeldungsdatum: 21. November 2012
Beiträge: 13922
|
brainchild schrieb: root@bruno ~ # ip a :(
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP group default qlen 1000
link/ether 00:26:2d:01:8b:7b brd ff:ff:ff:ff:ff:ff
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 00:26:2d:01:8b:7b brd ff:ff:ff:ff:ff:ff
inet 192.168.2.10/24 brd 192.168.2.255 scope global br0
valid_lft forever preferred_lft forever
root@bruno ~ #
Versuch mal ohne das br0-Interface. Ob dann lo wieder die IP-Adresse 127.0.0.1 bekommt?
|
brainchild
(Themenstarter)
Anmeldungsdatum: 1. Dezember 2007
Beiträge: 17
|
| root@bruno ~ # cat /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.lo.disable_ipv6=1
|
Ich habs! Es lag an meiner sysctrl.cfg. Ich hatte dort IPv6 deaktiviert. Interessanterweise bekommt das loopback-Interface dann keine IP. Einträge raus, reboot und es funktioniert alles wie erwartet. Nur wie deaktiviere ich IPv6 in ubuntu?
|