Hi, I just set up this new forum account because I am not sure if what I am seeing in this new IP Fire install I did recently is a problem. I set the domain to use home.arpa per RFC8375 RFC 8375: Special-Use Domain 'home.arpa.'
So IP Fire shows ipfire.home.arpa and hostname shows localhost.home.arpa, ok, good. But, when I login to IP Fire using ssh, and ping localhost in the terminal, IP Fire responds “64 bytes from localhost.localdomain (127.0.0.1)”. I looked up how to edit hosts file under /etc, and changed that from “127.0.0.1 localhost.localdomain localhost” to “127.0.0.1 localhost.home.arpa localhost”, saved the file, and rebooted IP Fire. After IP Fire restarts, I login to it, and run “ping localhost” in the terminal again, and the response is “64 bytes from localhost.localdomain (127.0.0.1)”. I searched around on Google, and see this is kind of a common issue with Linux distros. One of the solutions I tried was adding “kernel.hostname = localhost.home.arpa” to sysctl.conf, saving that file, doing sysctl -p in the IP Fire terminal, rebooting the system, and once again pinging “localhost” in a terminal brings back the same host name “localhost.localdomain”. So I’m not sure, it seems IP Fire is using the “home.arpa” domain, and the DNS and networking seems to work fine, but, I think this is kind of strange, that the IP Fire admin page shows “localhost.home.arpa” and yet in the system terminal IP Fire seems to think it is localhost on localdomain. Any advice, or suggestions how to get these to parity, so they do not contradict each other? Or is this a nothing burger. I have a PC and networking background, and education, and from what I remember, I cannot see this kind of disparity in the localhost FQDN not matching the Domain information for the system working well, or not causing connection or security issues in the long run. Thanks -HR
hello Hanlon - Welcome to the IPFire Community!
This is a little hard to follow. Images / screenshots will help!
Is this the screen that you set domain to home.arpa??
If not, where was it set to home.arpa??
I think this should be just home (and not home.arpa).
Still trying to learn the forum, I posted some replies but uh, oops, deleted by accident.
Yeah Jon, if you set that to home.arpa it looks like this in IP Fire here:
pfSense was talking about this about two years after IETF made the change allowing home.arpa to be used in residential homes Todo #10533: Change default domain for new installations from "localdomain" to "home.arpa" - pfSense - pfSense bugtracker
I still cannot figure out what is overwriting /etc/hosts each time I start IP Fire so localhost is defined as:
127.0.0.1 localhost.localdomain localhost
I just edit the /etc/hosts file each time I start IP Fire and change that to read:
127.0.0.1 localhost localhost
and IP Fire is good for the day. Ping responses in the IP Fire terminal for localhost come back:
[root@ipfire ~]# ping localhost
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.049 ms
after I make the edit and save it to /etc/hosts
Gets kind of tiresome to have to make that edit each time I start IP Fire. Sure would like to know what is set to write /etc/hosts to read ‘localhost.localdomain’ and fix that. Oh well.
@jon gives you the right hint, to change the domain for the red LAN you must do the
setup
command again and change this domain here, this works permanently.
One more time to remember the basic processing in IPFire.
The config is hold (mostly) in IPFire’s own settings files. The system generates the configurations of the Linux processes from this. Local modifications should be set in the associated .conf.local files, if available.
I didn’t look at this special system setting, but I suppose conservatively the system domain is pulled from the IPFire config at startup. This means also, that the domain is valid not before a restart.
Ah, ok, I found why this is happening. Each time IP Fire boots and connects using DHCP, the hosts file under /etc is changed so it contains
127.0.0.1 localhost.localdomain localhost
192.168.x.x gateway
I changed the IP address my ISP gave IPF as gateway to .x.x
Ok. So, IPF keeps the home.arpa domain change I make in setup, but when I ping localhost in a terminal, it comes back
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=1 ttl=64 time=0.061 ms
and that’s because the /etc/hosts file is renewed after each boot and contains the updated gateway IP address.
Ok. And this is for Unbound to know what the gateway address is.
I was using a static IP address before, and this was still happening, the hosts file under /etc was being restored to
127.0.0.1 localhost.localdomain localhost
Ok, so not a problem. I just have to edit /etc/hosts and remove .localdomain each time IP Fire starts. Got it.
But, home.arpa persists and is the domain IP Fire uses, so that’s good.
Thanks for the advice.
When you execute cat /etc/hosts
on the ipfire machine or connected by ssh via root, it should output the loop back, the host and the gateway.
The domain name can be anything since this DNS server is behind a firewall. So the system will not care if its called dog.frisbee as far as that is concern.
I have the domain sdak on my system. My ipfire machine is named blktower.
So when I execute cat /etc/hosts
I get:
127.0.0.1 localhost
10.65.64.200 blktower.sdak blktower
(outside ip address) gateway
loopback (127.0.0.1) is always localhost on linux as that is baked for software intentionally and should not be changed. Some people add another name to the entry, but localhost must be present and changing that can cause failures with software installed or can be installed in Linux.
The only valid place to define the domain (localdomain) as well as the machine name (localhost) is in setup at install. Because of the default software packages that are installed so you just can’t edit the hosts file and change the domain. Because Unbound defines resolvers based on what the domain was named when its installed and will always add back the entry if not present. So you just can’t change the name in hosts file on this version of Linux like you can on regular desktop versions of Linux.
Since you have anything that has localdomain as a name, it tells me that the instal was a default setup and you need to reinstall ipfire so you can put a name in there instead of this name it auto fills. Other Linux os use the name ‘local’ as the default local domain name if its not defined by the user.