1

It's possible use IPs instead of URLs for the repositories in sources.list?

(And how)

13
  • 3
    It's wrong. Don't do it. URLs won't always point to the same IP address. Commented Dec 20, 2020 at 5:03
  • can be useful to avoid DNS hack Commented Dec 20, 2020 at 6:01
  • 1
    Doesn't matter. Even if you get a MITM attack from DNS, the repositories, including package file checksum, are signed with a GPG key. This can't lead to apt-get installing a fake package. Commented Dec 20, 2020 at 16:58
  • 1
    It was installed when the OS was installed, and then kept up to date. For Debian, explanations there: wiki.debian.org/SecureApt Commented Dec 20, 2020 at 17:01
  • 1
    Looks like this question is a big XY problem anyway. Commented Dec 20, 2020 at 17:09

1 Answer 1

1

You can use an IP instead of an url in your sources.list.

here is an example: To convert deb http://deb.debian.org/debian buster main, you need to get the ip of the url, but in this case it is a redirector! . The right URL to convert is the url of the debian mirror e,g: ftp2.de.debian.org/debian/

nslookup ftp2.de.debian.org 

Use dig, nslookup ... to get the IP address

sample output:

... Non-authoritative answer: ftp2.de.debian.org canonical name = ftp.halifax.rwth-aachen.de. Name: ftp.halifax.rwth-aachen.de Address: 137.226.34.46 Name: ftp.halifax.rwth-aachen.de Address: 2a00:8a60:e012:a00::21 

then edit your /etc/apt/sources.list as follows:

deb http://137.226.34.46/debian buster main 

The debian security repository:

deb http://20.49.228.237/debian-security/ buster/updates main 
4
  • thx for answer. Know how get the mirror for security updates? "security.debian.org" Commented Dec 20, 2020 at 16:39
  • it says "does not have a Release file" Commented Dec 20, 2020 at 16:47
  • @user406126 I have edited my answer. Commented Dec 20, 2020 at 17:19
  • 1
    that security IP pertains to Microsoft, not Debian foundation. There's any source where can lookup the mirrors myself? Commented Dec 20, 2020 at 17:26

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.