Using the IP in source.list - I have no name resolution

Kernels, Network, and Services configuration
Post Reply
Message
Author
YuriAoto
Posts: 3
Joined: 2021-03-12 11:32

Using the IP in source.list - I have no name resolution

#1 Post by YuriAoto »

Dear all,

I am having trouble with name resolution in a server with debian and I cannot even install packages, such as dig or nslookup, to investigate the issue. I tried to use the IP addres in the source.list, as described here:

https://wiki.debian.org/SourcesList#Name_Resolution

but it failed. I did use the IP from `host` (in another machine):

Code: Select all

(at a computer with name resolution)$ host deb.debian.org
deb.debian.org is an alias for debian.map.fastlydns.net.
debian.map.fastlydns.net has address 151.101.178.132
debian.map.fastlydns.net has IPv6 address 2a04:4e42:2a::644
And thus:

Code: Select all

$ cat /etc/apt/sources.list

deb http://151.101.178.132/debian contrib main 
But it does not update:;

Code: Select all

$ apt update
Err:1 http://151.101.178.132/debian contrib InRelease
  500  Domain Not Found [IP: 151.101.178.132 80]
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://151.101.178.132/debian/dists/contrib/InRelease  500  Domain Not Found [IP: 151.101.178.132 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.

Any hints??

p.H
Posts: 1969
Joined: 2017-09-17 07:12
Been thanked: 9 times

Re: Using the IP in source.list - I have no name resolution

#2 Post by p.H »

Using the IP address in URL does not work when the server uses virtual hosts.
If you have no DNS resolution, you can define hostnames in /etc/hosts.

YuriAoto
Posts: 3
Joined: 2021-03-12 11:32

Re: Using the IP in source.list - I have no name resolution

#3 Post by YuriAoto »

Right, I see.

I actually solved the dns problem, it was on the firewall of my gateway, that was not properly configured (iptables and firewalld are very confusing to me).

But thank you anyway!

Yuri

Post Reply