View previous topic :: View next topic |
Author |
Message |
Goverp Advocate
Joined: 07 Mar 2007 Posts: 2179
|
Posted: Mon Oct 07, 2024 7:16 pm Post subject: Where is domainname set for an internal network? |
|
|
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 |
|
|
bstaletic Guru
Joined: 05 Apr 2014 Posts: 374
|
|
Back to top |
|
|
Banana Moderator
Joined: 21 May 2004 Posts: 1746 Location: Germany
|
Posted: Mon Oct 07, 2024 9:07 pm Post subject: |
|
|
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 |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6148 Location: Dallas area
|
Posted: Mon Oct 07, 2024 9:17 pm Post subject: |
|
|
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 |
_________________ UM780, 6.1 zen kernel, gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
Ralphred l33t
Joined: 31 Dec 2013 Posts: 654
|
Posted: Mon Oct 07, 2024 9:32 pm Post subject: |
|
|
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 |
|
|
pingtoo Veteran
Joined: 10 Sep 2021 Posts: 1251 Location: Richmond Hill, Canada
|
Posted: Mon Oct 07, 2024 10:12 pm Post subject: |
|
|
Possible another place you need to modify is /etc/resolv.conf (or however your system resolv.conf constructed)
You mostly want to setup configuration option "search". Using your example you may want to add /etc/resolv.conf: | search home.arpa internal
nameserver <ip address of your dnsmasq service> | see also man resolv.conf
Unless you are using mDNS which expect your each node name is fully qualified. (or add ".local" for short name)
Basically in the Name resolution process every thing is a "domain" name. most of time we call it hostname it is actually a short domain name. the FQDN is the one have the "." (dot) at the end of the long string. |
|
Back to top |
|
|
|