You are not logged in.

#1 2024-10-19 20:25:50

czarcastic_comment
Member
Registered: 2024-05-17
Posts: 7

[Solved] Adding custom domains to systemd-resolved

I have a set of network connected machines A, B, C ... that can connect via wired Ethernet, Wi-Fi or VPN. Right now, I have a list of bash aliases that define the IP address of each:

alias A_en=1.0.0.1; alias A_wl=192.168.1.24; alias A_vpn=100.1.2.3
alias B_en=...

This is getting unruly as the list of machines grows. Moreover, its slightly annoying to have to expand the bash variable:

ssh user@$A_wl

I know I could accomplish this with a bash script and a config file but I also know the right tool for this is my resolver.

How do I add custom domain-ip address pairs to resolved.conf and resolveconf.conf without running a separate DNS server on the machine?
I tried reading the resolved article https://wiki.archlinux.org/title/Systemd-resolved and resolved man page https://man.archlinux.org/man/systemd-resolved.8 but it went over my head.
Ideally, I could use the hostname by itself to resolve to the fastest available connection or be able to specify a particular connection manually.

Last edited by czarcastic_comment (2024-10-19 23:47:12)

Offline

#2 2024-10-19 23:47:00

czarcastic_comment
Member
Registered: 2024-05-17
Posts: 7

Re: [Solved] Adding custom domains to systemd-resolved

The solution is the /etc/hosts file.

Offline

Board footer

Powered by FluxBB