[réseau] wget + dns (En cours)

Applications, problèmes de configuration réseau
Avatar de l’utilisateur
dna
Hankyu
Messages : 17
Inscription : ven. 14 janv. 2011, 15:47

[réseau] wget + dns (En cours)

Message par dna »

Hello,
Depuis quelque temps déjà j'ai un soucis avec wget. Voila le background :
Je reste en ipv4 pour le moment. J'ai stopper le chargement automatique du module ipv6 via modprobe.conf
https://wiki.archlinux.org/index.php/Disabling_IPv6

Code : Tout sélectionner

# disable autoload of ipv6
alias net-pf-10 off
Chaque fois que j'utilise wget je dois le forcer à utiliser uniquement ipv4, sinon il n'arrive pas à résoudre les noms d'hôte (c'est ce qu'il me dit). On dirai un problème de dns, mais non. Le plus étrange est que je reçoit des réponses valide des serveurs dns.

Example :

Code : Tout sélectionner

dna@DNA-NOTEBOOK:~ # wget google.ch
--2011-05-22 19:44:28--  http://google.ch/
Resolving google.ch... failed: Name or service not known.
wget: unable to resolve host address “google.ch”
Et pourtant voila le trafic sur mon interface :

Code : Tout sélectionner

dna@DNA-NOTEBOOK:~ # sudo tcpdump -i wlan0 -n -vvv port 53
Password: 
tcpdump: listening on wlan0, link-type EN10MB (Ethernet), capture size 65535 bytes
19:44:28.764137 IP (tos 0x0, ttl 64, id 27515, offset 0, flags [DF], proto UDP (17), length 55)
    192.168.1.156.55617 > 192.168.1.1.53: [udp sum ok] 39506+ A? google.ch. (27)
19:44:28.764264 IP (tos 0x0, ttl 64, id 27516, offset 0, flags [DF], proto UDP (17), length 55)
    192.168.1.156.55617 > 192.168.1.1.53: [udp sum ok] 22169+ AAAA? google.ch. (27)
19:44:28.775649 IP (tos 0x0, ttl 255, id 12423, offset 0, flags [none], proto UDP (17), length 103)
    192.168.1.1.53 > 192.168.1.156.55617: [udp sum ok] 39506 q: A? google.ch. 3/0/0 google.ch. [2m1s] A 74.125.79.147, google.ch. [2m1s] A 74.125.79.99, google.ch. [2m1s] A 74.125.79.104 (75)
19:44:28.777189 IP (tos 0x0, ttl 255, id 12424, offset 0, flags [none], proto UDP (17), length 55)
    192.168.1.1.53 > 192.168.1.156.55617: [udp sum ok] 22169- q: AAAA? google.ch. 0/0/0 (27)
#
# google.ch à été résolu en adresse ipv4, pourtant wget réinterroger le dns
#
19:44:28.777314 IP (tos 0x0, ttl 64, id 27519, offset 0, flags [DF], proto UDP (17), length 55)
    192.168.1.156.40917 > 192.168.1.1.53: [udp sum ok] 39506+ A? google.ch. (27)
19:44:28.777330 IP (tos 0x0, ttl 64, id 27520, offset 0, flags [DF], proto UDP (17), length 55)
    192.168.1.156.40917 > 192.168.1.1.53: [udp sum ok] 22169+ AAAA? google.ch. (27)
19:44:28.789321 IP (tos 0x0, ttl 255, id 12427, offset 0, flags [none], proto UDP (17), length 55)
    192.168.1.1.53 > 192.168.1.156.40917: [udp sum ok] 22169- q: AAAA? google.ch. 0/0/0 (27)
19:44:28.789402 IP (tos 0x0, ttl 64, id 27522, offset 0, flags [DF], proto UDP (17), length 55)
    192.168.1.156.51684 > 192.168.1.1.53: [udp sum ok] 40457+ A? google.ch. (27)
19:44:28.789415 IP (tos 0x0, ttl 64, id 27523, offset 0, flags [DF], proto UDP (17), length 55)
    192.168.1.156.51684 > 192.168.1.1.53: [udp sum ok] 62851+ AAAA? google.ch. (27)
19:44:28.792407 IP (tos 0x0, ttl 255, id 12428, offset 0, flags [none], proto UDP (17), length 103)
    192.168.1.1.53 > 192.168.1.156.40917: [udp sum ok] 39506 q: A? google.ch. 3/0/0 google.ch. [2m22s] A 74.125.79.99, google.ch. [2m22s] A 74.125.79.104, google.ch. [2m22s] A 74.125.79.147 (75)
19:44:28.801419 IP (tos 0x0, ttl 255, id 12431, offset 0, flags [none], proto UDP (17), length 103)
    192.168.1.1.53 > 192.168.1.156.51684: [udp sum ok] 40457 q: A? google.ch. 3/0/0 google.ch. [2m22s] A 74.125.79.104, google.ch. [2m22s] A 74.125.79.147, google.ch. [2m22s] A 74.125.79.99 (75)
19:44:28.803435 IP (tos 0x0, ttl 255, id 12432, offset 0, flags [none], proto UDP (17), length 55)
    192.168.1.1.53 > 192.168.1.156.51684: [udp sum ok] 62851- q: AAAA? google.ch. 0/0/0 (27)
19:44:28.803460 IP (tos 0x0, ttl 64, id 27527, offset 0, flags [DF], proto UDP (17), length 55)
    192.168.1.156.43071 > 192.168.1.1.53: [udp sum ok] 40457+ A? google.ch. (27)
19:44:28.803471 IP (tos 0x0, ttl 64, id 27528, offset 0, flags [DF], proto UDP (17), length 55)
    192.168.1.156.43071 > 192.168.1.1.53: [udp sum ok] 62851+ AAAA? google.ch. (27)
19:44:28.813627 IP (tos 0x0, ttl 255, id 12436, offset 0, flags [none], proto UDP (17), length 103)
    192.168.1.1.53 > 192.168.1.156.43071: [udp sum ok] 40457 q: A? google.ch. 3/0/0 google.ch. [2m1s] A 74.125.79.99, google.ch. [2m1s] A 74.125.79.104, google.ch. [2m1s] A 74.125.79.147 (75)
19:44:28.815578 IP (tos 0x0, ttl 255, id 12437, offset 0, flags [none], proto UDP (17), length 55)
    192.168.1.1.53 > 192.168.1.156.43071: [udp sum ok] 62851- q: AAAA? google.ch. 0/0/0 (27)
^C
16 packets captured
16 packets received by filter
0 packets dropped by kernel
Ce qui m'étonne, c'est que même en désactivant le module ipv6. wget interroge le dns pour des adresse ipv6... normal? ipv6 over ipv4?

Voila mon wgetrc (Je ne l'ai pas touché).

Code : Tout sélectionner

###
### Sample Wget initialization file .wgetrc
###

## You can use this file to change the default behaviour of wget or to
## avoid having to type many many command-line options. This file does
## not contain a comprehensive list of commands -- look at the manual
## to find out what you can put into this file.
##
## Wget initialization file can reside in /usr/local/etc/wgetrc
## (global, for all users) or $HOME/.wgetrc (for a single user).
##
## To use the settings in this file, you will have to uncomment them,
## as well as change them, in most cases, as the values on the
## commented-out lines are the default values (e.g. "off").


##
## Global settings (useful for setting up in /usr/local/etc/wgetrc).
## Think well before you change them, since they may reduce wget's
## functionality, and make it behave contrary to the documentation:
##

# You can set retrieve quota for beginners by specifying a value
# optionally followed by 'K' (kilobytes) or 'M' (megabytes).  The
# default quota is unlimited.
#quota = inf

# You can lower (or raise) the default number of retries when
# downloading a file (default is 20).
#tries = 20

# Lowering the maximum depth of the recursive retrieval is handy to
# prevent newbies from going too "deep" when they unwittingly start
# the recursive retrieval.  The default is 5.
#reclevel = 5

# By default Wget uses "passive FTP" transfer where the client
# initiates the data connection to the server rather than the other
# way around.  That is required on systems behind NAT where the client
# computer cannot be easily reached from the Internet.  However, some
# firewalls software explicitly supports active FTP and in fact has
# problems supporting passive transfer.  If you are in such
# environment, use "passive_ftp = off" to revert to active FTP.
#passive_ftp = off

# The "wait" command below makes Wget wait between every connection.
# If, instead, you want Wget to wait only between retries of failed
# downloads, set waitretry to maximum number of seconds to wait (Wget
# will use "linear backoff", waiting 1 second after the first failure
# on a file, 2 seconds after the second failure, etc. up to this max).
#waitretry = 10


##
## Local settings (for a user to set in his $HOME/.wgetrc).  It is
## *highly* undesirable to put these settings in the global file, since
## they are potentially dangerous to "normal" users.
##
## Even when setting up your own ~/.wgetrc, you should know what you
## are doing before doing so.
##

# Set this to on to use timestamping by default:
#timestamping = off

# It is a good idea to make Wget send your email address in a `From:'
# header with your request (so that server administrators can contact
# you in case of errors).  Wget does *not* send `From:' by default.
#header = From: Your Name <username@site.domain>

# You can set up other headers, like Accept-Language.  Accept-Language
# is *not* sent by default.
#header = Accept-Language: en

# You can set the default proxies for Wget to use for http, https, and ftp.
# They will override the value in the environment.
#https_proxy = http://proxy.yoyodyne.com:18023/
#http_proxy = http://proxy.yoyodyne.com:18023/
#ftp_proxy = http://proxy.yoyodyne.com:18023/

# If you do not want to use proxy at all, set this to off.
#use_proxy = on

# You can customize the retrieval outlook.  Valid options are default,
# binary, mega and micro.
#dot_style = default

# Setting this to off makes Wget not download /robots.txt.  Be sure to
# know *exactly* what /robots.txt is and how it is used before changing
# the default!
#robots = on

# It can be useful to make Wget wait between connections.  Set this to
# the number of seconds you want Wget to wait.
#wait = 0

# You can force creating directory structure, even if a single is being
# retrieved, by setting this to on.
#dirstruct = off

# You can turn on recursive retrieving by default (don't do this if
# you are not sure you know what it means) by setting this to on.
#recursive = off

# To always back up file X as X.orig before converting its links (due
# to -k / --convert-links / convert_links = on having been specified),
# set this variable to on:
#backup_converted = off

# To have Wget follow FTP links from HTML files by default, set this
# to on:
#follow_ftp = off

# To try ipv6 addresses first:
#prefer-family = IPv6

# Force the default system encoding
#locale = UTF-8

# Force the default remote server encoding
#remoteencoding = UTF-8

# default root certs location
ca_certificate=/etc/ssl/certs/ca-certificates.crt
J'ai essayer d'y ajouter

Code : Tout sélectionner

prefer-family = IPv4
ou

Code : Tout sélectionner

prefer-family = none
mais cela ne change rien

J'utilise mon router comme serveur dns. Il date depuis un moment déjà et ne supporte pas les requêtes dns type AAAA (Encore moin ipv6). Voila pourquoi je ne reçoit aucune réponse. Mais pourquoi wget n'utilise-t-il pas l'adresse ipv4?

A noter que si j'utilise les dns de mon FAI directement. les requêtes dns AAAA sont résolues et wget fonctionne parfaitement. (Mais wget continue d'intérroger les dns pour des adresses ipv6)

J'imagine que c'est un problème relatif a wget. De mon point de vue, dès qu'une adresse est résolue elle devrait être utilisée et ce qu'elle soit ipv4 ou ipv6. (Si la technologie est disponible bien sur)

Bref, ma question est : Erreur de configuration ou wget à un soucis?
Si vous voulez plus d'infos n’hésitez pas.
Répondre