Quantcast
Channel: Debian User Forums
Viewing all articles
Browse latest Browse all 3441

Beginners Questions • Struggling with DNS and /etc/hosts

$
0
0
Hi,

Newbe to Debian and Bookworm in particular but with heaps of experience of other distros, but obviously not enough.

I am struggling a bit with DNS and don't see how DNS resolution is working. I need to override the default IP for mail.mydomain.com to an internal IP, 172.17.2.1, but I am blowed if I can get it to resolve correctly. In /etc/hosts I have put:

Code:

172.17.2.1 mail.mydomain.com
But it still resolves externally. In nsswitch.conf I have:

Code:

hosts:          files myhostname dns
But I still get name resolution to my external IP.

The NIC is set to DHCP and is picking up the ISP's name servers via their (locked down) router.

How do I get the server (in general) and postfix (in particular) to use the hosts file? resolvconf and systemd-resolved are not installed. I have briefly tried both but could not get postfix to resolve internally although I will admit to not rebooting after installing either.

What is the normal Debian Bookworm way of fixing this?

Statistics: Posted by nickh — 2024-07-15 17:55 — Replies 1 — Views 53



Viewing all articles
Browse latest Browse all 3441

Trending Articles