ubuntuusers.de

Probleme mit DNS & Proxy (langsam!)

Status: Gelöst | Ubuntu-Version: Server 14.04 (Trusty Tahr)
Antworten |

Dloeschmann

Avatar von Dloeschmann

Anmeldungsdatum:
3. Mai 2011

Beiträge: 16

Wohnort: Mittelfranken

Servus,

Kabel-Deutschland Modem mit coax und vollen 100.000Down und 6.000UP (bridged) geht 1:1 an Ubuntu 14.04 x64 Atom Dual-Core mit 4096 DDR3 mit Gigabit im ganzen Netz, dient als

-Router (iptables) -DNSmasq (config unten) -Squid3 (config unten) -isc-dhcp (authoritativ 10.0.0.0/8)

Zu meinem Problem:

Websiten & Co. laufen gefühlt sehr träge. Ab und zu fühlt es sich wie ein "burst" an (alles geht ratz fatz). Aber es gibt auch Tage da stottert ebay, amazon & co. vor sich hin. Ich hatte auch schon Phasen, da ging fast garnix.

Ich muss dazu erwähnen:

dnsmasq läuft mit einer anti_spamm_fie: Viele blacklisted domains zeigen DNS-Mäßig auf 127.0.0.1 Genauso bei squid (blacklist url & parts).

Ich denke am squid kanns nicht liegen, da er mir seine blocked seite zeigen müsste. Aber bei ebay & co werden im Hintergrund die statistic/analystic seiten mitgeladen und da zeigen gut 30% auf localhost (ich denke hier gibts einfach die lange wartezeit oder)?

Macbook (OSX) Windows 8.1 Windows 7 (egal ob 802.11n oder Gigabit)

quasi OS und Hardwareunabhängig

1
2
3
4
5
6
7
8
9
dnsmasq.conf
# DNS
local=/home/
domain=home
domain-needed
bogus-priv
strict-order
resolv-file=/etc/dnsmasq.resolv.conf
cache-size=2048
 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
squid3.conf

## Squid.conf ##
cache_log /var/log/squid3/cache.log
cache_store_log /var/log/squid3/store.log
access_log /var/log/squid3/access.log squid
cache_mgr squid@censored
forwarded_for off
via off

# ACL
acl CONNECT method CONNECT
acl SSL_ports port 443
acl Safe_ports port 1025-65535	# unregistered ports
acl Safe_ports port 21		# ftp
acl Safe_ports port 210		# wais
acl Safe_ports port 280		# http-mgmt
acl Safe_ports port 443		# https
acl Safe_ports port 488		# gss-http
acl Safe_ports port 591		# filemaker
acl Safe_ports port 70		# gopher
acl Safe_ports port 777		# multiling http
acl Safe_ports port 80		# http
acl home src 10.0.0.0/8
acl localhost src 127.0.0.1/32 ::1
acl manager proto cache_object
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
#acl blacklist dstdomain -i "/etc/squid3/blacklist_domain"
acl blacklist dstdomain -i "/etc/squid3/blacklist"
acl blacklist2 dstdomain -i "/etc/squid3/blacklist2"
acl blacklist_url dstdomain -i "/etc/squid3/blacklist_url"
acl blacklist_custom dstdomain -i "/etc/squid3/blacklist_custom"

cache_mem 3172 MB
cache_replacement_policy heap LFUDA
memory_replacement_policy heap LFUDA
coredump_dir /squid
cache_dir diskd /squid 4096 16 256
log_fqdn off
cache_store_log none
dns_nameservers 127.0.0.1
half_closed_clients off
cache_swap_high 90%
cache_swap_low 70%
pipeline_prefetch on
snmp_port 0
snmp_access deny all
icp_port 0
htcp_port 0
icp_access deny all
htcp_access deny all

# ACCESS
http_access deny blacklist
http_access deny blacklist2
http_access deny blacklist_url
http_access deny blacklist_custom
http_access allow localhost
http_access allow home
http_access allow manager localhost
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny all
http_access deny manager
http_port 10.0.0.1:3128 transparent

memory_pools on
memory_pools_limit 1024 MB
maximum_object_size 2048 KB
maximum_object_size_in_memory 1024 KB
memory_replacement_policy heap GDSF

ipcache_size 4096
ipcache_low 90
ipcache_high 95


refresh_pattern -i (/cgi-bin/|\?) 0	0%	0
refresh_pattern .		0	20%	4320
refresh_pattern ^ftp:		1440	20%	10080
refresh_pattern ^gopher:	1440	0%	1440

lubux

Anmeldungsdatum:
21. November 2012

Beiträge: 14347

Dloeschmann schrieb:

dnsmasq läuft mit einer anti_spamm_fie: Viele blacklisted domains zeigen DNS-Mäßig auf 127.0.0.1 ... da zeigen gut 30% auf localhost (ich denke hier gibts einfach die lange wartezeit oder)?

Das könnte so sein. Lass mal als Test, die mal dns-mäßig nicht auf 127.0.0.1 (localhost) zeigen, sondern auf eine IP-Adresse (die Du nie benutzt) und blocke den output zu dieser IP-Adresse mit iptables und dem target REJECT (... nicht mit DROP). Z. B.:

sudo iptables -I OUTPUT 1 -d 193.169.13.13 -j REJECT

Dloeschmann

(Themenstarter)
Avatar von Dloeschmann

Anmeldungsdatum:
3. Mai 2011

Beiträge: 16

Wohnort: Mittelfranken

hi,

danke für den Tipp. Hat leider nichts gebracht.. Die Browser melden immer noch teilw. "warten auf bspw. google-analytics.com"

obwohl das von iptables nun rejected wird.

lubux

Anmeldungsdatum:
21. November 2012

Beiträge: 14347

Dloeschmann schrieb:

Die Browser melden immer noch teilw. "warten auf bspw. google-analytics.com"

Machst Du lediglich in der /etc/hosts, die Umleitung von "google-analytics.com" auf die IP-Adresse, die von iptables rejected wird? Sind alle dns-caches (Router, Rechner, ...) geleert? Evtl. zusätzlich/ergänzend auch mit dnsspoof (... als m-i-t-m) auf dem Rechner, für alle Zugriffe von dort auf udp-Port 53 probieren. Benutzt Du IPv6?

~$ host -t AAAA google-analytics.com
google-analytics.com has IPv6 address 2a00:1450:4001:809::1014

Wie ist die Ausgabe von:

host -t A google-analytics.com 8.8.8.8

? Z. B.:

:~$ host -t A google-analytics.com 8.8.8.8
Using domain server:
Name: 8.8.8.8
Address: 8.8.8.8#53
Aliases: 

google-analytics.com has address 193.169.12.12
:~$ ping -c 1 -W 2 193.169.12.12
PING 193.169.12.12 (193.169.12.12) 56(84) bytes of data.
From 192.168.178.## icmp_seq=1 Destination Port Unreachable

--- 193.169.12.12 ping statistics ---
0 packets transmitted, 0 received, +1 errors

Dloeschmann

(Themenstarter)
Avatar von Dloeschmann

Anmeldungsdatum:
3. Mai 2011

Beiträge: 16

Wohnort: Mittelfranken

sorry hat leider bisschen gedauert:

ich mache eigtl. nur die hosts-umleitung.

1
2
3
4
5
6
 ping -c1 -W 2 193.169.255.254
PING 193.169.255.254 (193.169.255.254) 56(84) bytes of data.
From 188.193.30.129 icmp_seq=1 Destination Port Unreachable

--- 193.169.255.254 ping statistics ---
0 packets transmitted, 0 received, +1 errors
host -t A google-analytics.com 8.8.8.8
Using domain server:
Name: 8.8.8.8
Address: 8.8.8.8#53
Aliases:

google-analytics.com has address 173.194.113.52
google-analytics.com has address 173.194.113.51
google-analytics.com has address 173.194.113.50
google-analytics.com has address 173.194.113.49
google-analytics.com has address 173.194.113.48

lubux

Anmeldungsdatum:
21. November 2012

Beiträge: 14347

Dloeschmann schrieb:

ich mache eigtl. nur die hosts-umleitung.

host -t A google-analytics.com 8.8.8.8
Using domain server:
Name: 8.8.8.8
Address: 8.8.8.8#53
Aliases:

google-analytics.com has address 173.194.113.52
google-analytics.com has address 173.194.113.51
google-analytics.com has address 173.194.113.50
google-analytics.com has address 173.194.113.49
google-analytics.com has address 173.194.113.48

Diese hosts-Umleitung hat bei dir, keine Auswirkungen auf die Namensauflösung.

Antworten |