Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Where is domainname set for an internal network?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Goverp
Advocate
Advocate


Joined: 07 Mar 2007
Posts: 2132

PostPosted: Mon Oct 07, 2024 7:16 pm    Post subject: Where is domainname set for an internal network? Reply with quote

Some time ago I decided it would be nice to have a name for my local network - i.e. the WAN attached to my ASDL router, rather than the whole internet outside. I chose the domain name ".home.network", but I now read that among several suitable special names defined in a couple of RFCs are ".home.arpa." and ".internal".
(IIUC ".home.arpa." and ".home.arpa" are virtually the same thing, except the former explicitly states that it's the top level domain name.)
I have a local DNS resolver - dnsmasq - running on a Raspberry Pi, which forwards new dns queries to 9.9.9.9

The question is, where did I specify it in my Gentoo netifrc setup? I thought there was a file /etc/domainname, but that seems not to be the case. Nor is it in my /etc/config.d/net.
I guess I need to update the dnsmasq configuration, and presumably /etc/host, and any applications with qualified names (mostly mailto addresses in things like /etc/smartd.conf). But have I missed something? It seems too simple just to be in /etc/hosts. I presume the /etc/hostname is just the lowest level unqualified name.

There's also CONFIG_DEFAULT_HOSTNAME in the kernel, but I expect that's irrelevant for most uses.
_________________
Greybeard
Back to top
View user's profile Send private message
bstaletic
Guru
Guru


Joined: 05 Apr 2014
Posts: 333

PostPosted: Mon Oct 07, 2024 7:23 pm    Post subject: Reply with quote

I might be wrong, but isn't domain set in the /etc/hosts file?
https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/System/en#The_hosts_file
Back to top
View user's profile Send private message
Banana
Moderator
Moderator


Joined: 21 May 2004
Posts: 1669
Location: Germany

PostPosted: Mon Oct 07, 2024 9:07 pm    Post subject: Reply with quote

https://linux.die.net/man/1/hostname
Quote:
Display the FQDN (Fully Qualified Domain Name). A FQDN consists of a short host name and the DNS domain name. Unless you are using bind or NIS for host lookups you can change the FQDN and the DNS domain name (which is part of the FQDN) in the /etc/hosts file. See the warnings in section THE FQDN above, and avoid using this option; use hostname --all-fqdns instead.


So yes, it should go into /etc/hosts
_________________
Forum Guidelines

PFL - Portage file list - find which package a file or command belongs to.
My delta-labs.org snippets do expire
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6145
Location: Dallas area

PostPosted: Mon Oct 07, 2024 9:17 pm    Post subject: Reply with quote

use hosts if you are setting a single or a few hosts.

try /etc/networks
Code:

$ cat /etc/networks
# /etc/networks
#
# This file describes a number of netname-to-adress
# mappings for the TCP/IP subsytem. It is mostly
# used at boot time, when no name servers are running.
#

loopback   127.0.0.0
link-local   169.254.0.0
home      192.168.1.0

_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
Ralphred
Guru
Guru


Joined: 31 Dec 2013
Posts: 596

PostPosted: Mon Oct 07, 2024 9:32 pm    Post subject: Reply with quote

Banana wrote:
So yes, it should go into /etc/hosts

Meh, don't discount the fact you may have just reached the threshold of "plausible uses of a local named server", setting one up to ease the "administrative burden" as well as act as a local DNS cache is a cake walk for the average 'ntoo user...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum