What's new

SSH permanently modify hosts file?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

serpy

New Around Here
Hi all,

I have an Asus RT-AX55 which does not support Merlin.

I have SSH into the router and modified the hosts file however it clears my entry when the modem reboots.

Is there a way to permanently commit an entry that will be persistent over a reboot?

Perhaps there is a custom firmware for this router

If not i was considering modifying a firmware update to achieve this.
 
It depends on what sort of modification you're making to the hosts file. What is it?
I am adding a new entry:
192.168.0.10 nassy

the local ip and name of my NAS.

The reason is so I can access my docker images using the same url when on my home wifi and on tailscale

Android cant lookup hostnames so adding the entry solves my issue however gets wiped with a router reset.
 
I am adding a new entry:
192.168.0.10 nassy
You can do this by creating a manual DHCP reservation at LAN - DHCP Server > Manually Assigned IP...

Even if the host isn't a DHCP client you can use the option above to create a DNS entry for the host name. You don't even need to specify the actual MAC address (although it's advisable), you could use 00:00:00:00:00:00.

Untitled.png
 
Last edited:
You can do this by creating a manual DHCP reservation at LAN - DHCP Server > Manually Assigned IP...

Even if the host isn't a DHCP client you can use the option above to create a DNS entry for the host name. You don't even need to specify the actual MAC address (although it's advisable), you could use 00:00:00:00:00:00.

View attachment 56371
I feel a bit silly not trying this first but it was exactly what I needed to do.

I checked the hosts file and its persistent across reboots, the only difference is it added a fullstop to the end of the hostname
manually adding This with a fullstop will still be wiped, but doesn't matter as now I understand it can be done through the GUI.

Appreciate the help for solving my issue!
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top