[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#75388: apt: apt-get not reading /etc/hosts



Package: apt
Version: 0.3.19
Severity: normal

Last week I submitted a typo bug for apt-get when the hostname name cannot
be resolved properly.

After thinking about it, though, it would appear there's a problem with
apt-get itself when it gives the error message.

My situation is that I am behind a Windows P[r]oxy Server, and aren't able
to use a DNS server. I am however able to get through the Proxy Server by
plain IP address rather than by name (which says a lot about the security of
Microsoft network products, not that that is much news).  I have therefore
included a handful of key machines in my /etc/hosts file for access to the
world while I'm behind this Microsoft fog.  For instance, I have 
130.95.128.50   ftp.uwa.edu.au
138.25.6.7      ftp.progsoc.uts.edu.au
in /etc/hosts, which are some Debian ftp servers in Australia.  

I can successfully ping  these machines, by IP address and by name:
drew@strider$ ping -c 3 130.95.128.50
PING 130.95.128.50 (130.95.128.50): 56 data bytes
64 bytes from 130.95.128.50: icmp_seq=0 ttl=240 time=1048.1 ms
64 bytes from 130.95.128.50: icmp_seq=1 ttl=240 time=858.5 ms
64 bytes from 130.95.128.50: icmp_seq=2 ttl=240 time=963.0 ms

--- 130.95.128.50 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 858.5/956.5/1048.1 ms
drew@strider$ 
drew@strider$ ping -c 3 ftp.uwa.edu.au
PING ftp.uwa.edu.au (130.95.128.50): 56 data bytes
64 bytes from 130.95.128.50: icmp_seq=0 ttl=240 time=1019.9 ms
64 bytes from 130.95.128.50: icmp_seq=1 ttl=240 time=899.5 ms
64 bytes from 130.95.128.50: icmp_seq=2 ttl=240 time=887.1 ms

--- ftp.uwa.edu.au ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 887.1/935.5/1019.9 ms
drew@strider$ 


I can also access the servers by name using direct ftp:
drew@strider$ ftp ftp.uwa.edu.au
Connected to ftp.uwa.edu.au.
220 ProFTPD 1.2.0pre10 Server (ftp.uwa.edu.au) [acheron.uwa.edu.au]
Name (ftp.uwa.edu.au:drew): ftp
331 Anonymous login ok, send your complete e-mail address as password.
Password:
230 Anonymous access granted, restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for file list.
drwxr-xr-x   4 root     root         4096 Jun 12 04:07 mirrors
drwxr-xr-x  11 99       kmem         4096 Aug 23 08:11 pub
226-Transfer complete.
226 Quotas off
ftp> bye
221 Goodbye.


I have these servers set up in sources.list for apt:
deb ftp://ftp.uwa.edu.au/mirrors/linux/debian woody main contrib non-free 
deb ftp://ftp.progsoc.uts.edu.au/pub/Linux/debian-non-US woody non-US/main non-US/contrib non-US/non-free

However, when I then try to run apt-get update, I get the error I mentioned
before:
drew@strider$ sudo apt-get update
Err ftp://ftp.progsoc.uts.edu.au woody/non-US/main Packages             
  Something wicked happend resolving 'ftp.progsoc.uts.edu.au/ftp'
Err ftp://ftp.uwa.edu.au woody/main Packages                            
  Something wicked happend resolving 'ftp.uwa.edu.au/ftp'
... etc.    

If I put the IP addresses instead of the names into sources.list, then
apt-get works fine:
drew@strider$ sudo apt-get update
Get:1 ftp://138.25.6.7 woody/non-US/main Packages [22.6kB]
Get:2 ftp://130.95.128.50 woody/main Packages [1080kB]
... etc.


Thus, it would appear that apt-get is not using /etc/hosts to resolve
hostnames, even though other programs (ping, ftp) do use it.

Thought you'd be interested :)

Drew.


-- System Information
Debian Release: woody
Kernel Version: Linux strider 2.2.17 #1 Fri Oct 13 13:29:55 EST 2000 i686 unknown

Versions of the packages apt depends on:
ii  libc6          2.1.95-1       GNU C Library: Shared libraries and Timezone
ii  libstdc++2.10  2.95.2-14      The GNU stdc++ library



Reply to: