What's new

YazFi Change Hostname for YazFi clients

  • 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!

One place to check for static DHCP reservations (assumes you are not using YazDHCP) is /jffs/nvram/dhcp_staticlist file and /jffs/nvram/custom_clientlist file using SSH.
Another place to look is in the NVRAM to see if anything is saved there. Via SSH issue a command like the following: nvram show 2>/dev/null | grep "dhcp_staticlist=" and nvram show 2>/dev/null | grep "custom_clientlist=".

Post edit
Wow getting closer now. Running this commnand shows a list with the names showing in YazFI. I am just not sure how clear this or how to edit.

nvram show 2>/dev/null | grep "custom_clientlist="
 
Wow getting closer now. Running this commnand shows a list with the names showing in YazFI. I am just not sure how clear this or how to edit.

nvram show 2>/dev/null | grep "custom_clientlist="
The following command run using SSH should clear the custom client list variable.

nvram set custom_clientlist=""

Note that you proceed at your own risk since incorrectly clearing NVRAM values may cause unexpected results. Clearing the custom client list value may also clear the custom names for other manual DHCP reservations other than those shown by YazFi.
 
Last edited:
The following command run using SSH should clear the custom client list variable.

nvram set custom_clientlist=""

Note that you proceed at your own risk since incorrectly clearing NVRAM values may cause unexpected results. Clearing the custom client list value may also clear the custom names for other manual DHCP reservations other than those shown by YazFi.
I really appreciate your help but that last part makes me nervous. Lol

Is there a way to modify the list instead of just clearing it out. 90% of my host names are fine just wanted to modify a few of my IoT ones.
 
I really appreciate your help but that last part makes me nervous. Lol

Is there a way to modify the list instead of just clearing it out. 90% of my host names are fine just wanted to modify a few of my IoT ones.
Any time you change anything via SSH you run the risk of causing unexpected issues or problems with the router. Running that code line "shouldn't" be an issue beyond clearing all custom list list entries, but as always you proceed at your own risk performing ANY action under the hood of the firmware. No idea if one can edit that custom client list to remove only the offending hostnames and keep others. If you decide not to do it, it's your choice. Without knowing what other changes you've made either in the GUI or through SSH (like adding/removing scripts if using Asus-Merlin firmware) the only other suggestion I can make is to perform a hard factory reset which should clear any manual DHCP IP reservations (including their hostnames). But not everyone wants to perform a hard factory reset and reconfigure when they're seeing weird things with their router that cannot easily be solved or corrected using the GUI and they don't want to use SSH.
 
I understand and I appreciate the info. I just wanted to know how to change them after I clear the list incase they show up as defaults names like before. For example my WeMo Switches showed up as WeMo_897 or something. I wanted to Change to WeMo - Living Room.
 
I just wanted to know how to change them after I clear the list incase they show up as defaults names like before. For example my WeMo Switches showed up as WeMo_897 or something. I wanted to Change to WeMo - Living Room.
As previously mentioned, one way is to create manual IP reservations YazFi clients for them where you can set your own hostname for each client...
https://github.com/jackyaz/YazFi/wi...verse-DNS-records#a-note-on-dhcp-reservations
https://www.snbforums.com/threads/y...inc-ssid-vpn-client.45924/page-32#post-473403

Edit to add: Using the forum search feature, there is (possible) mention of changing the hostname alone via dnsmasq.conf.add or dnsmasq.postconf file(s). See the following link (and that entire discussion).
https://www.snbforums.com/threads/h...ystem-log-wireless-log-tab.86939/#post-866509

Maybe something like the following (/jffs/scripts/dnsmasq.postconf) would work in YazFi, adjusted to suit your YazFi client MAC addresses and hostnames. Make sure to delete any entries for YazFi clients from the GUI's LAN > DHCP Server >Manually Assigned IP section. And make sure to restart YazFi to push any changes in the dnsmasq.postconf file.
Code:
#!/bin/sh
CONFIG=$1
source /usr/sbin/helper.sh
pc_append "dhcp-host=<MACADDRESS>,,<hostname>" $CONFIG
pc_append "dhcp-host=aa:bb:cc:dd:ee:ff,,WeMo-Kitchen" $CONFIG
pc_append "dhcp-host=gg:hh:ii:jj:kk:ll,,WeMo-FamilyRoom" $CONFIG

cat /jffs/addons/YazFi.d/.dnsmasq >> /etc/dnsmasq.conf # YazFi
 
Last edited:
I really appreciate your help but that last part makes me nervous. Lol

Is there a way to modify the list instead of just clearing it out. 90% of my host names are fine just wanted to modify a few of my IoT ones.

Many times before I have needed to "clean up" the "custom_clientlist" NVRAM variable because after some client devices are no longer in use (replaced or simply no longer work) the webGUI does not show them, but the old entries were still in NVRAM. This has happened with several ASUS router models (from relatives & friends) that I have helped with maintenance over the years, so I created a custom shell script that I've used many times to delete the obsolete or unwanted entries from the "custom_clientlist" variable.

I have updated this script to be able to modify/replace the client names if you so choose. I also added more error handling and user-friendly messages so it's a bit easier to use.

This script is now available on GitHub:
Bash:
mkdir -m 755 -p /jffs/scripts
curl -kLSs --retry 3 --retry-delay 5 --retry-connrefused  https://raw.githubusercontent.com/Martinski4GitHub/CustomMiscUtils/master/NVRAM/nvramCustomClientList.sh  -o /jffs/scripts/nvramCustomClientList.sh
chmod 755 /jffs/scripts/nvramCustomClientList.sh

The steps that I've used before to delete obsolete entries from "custom_clientlist" are the following:

1) First, make a backup of the current original value (to have it available just in case a restore is necessary or wanted later on):
Bash:
./nvramCustomClientList.sh backup

2) Now, show the current value that lists all the client entries:
Bash:
./nvramCustomClientList.sh show

3) Select the obsolete/unwanted "ClientName" from the available entries shown in step 2, and execute the command to simply test/check/verify the deletion changes:
Bash:
./nvramCustomClientList.sh modify "ClientName" -DELETE-

4) If the results of the temporary changes shown in step 3 are good and everything looks valid & correct, you can now make the change permanent by committing it with the following command:
Bash:
./nvramCustomClientList.sh docommit modify "ClientName" -DELETE-

5) "Rinse & Repeat" steps 2 thru 4 for any other "ClientName" entries you want to delete.


If for some reason you want to go back to the original NVRAM value, you can still restore it with the following command:
Bash:
./nvramCustomClientList.sh restore

However, when you're happy with the final changes and want to remove all temporary files & the backup, use the following command:
Bash:
./nvramCustomClientList.sh doclear


To modify/replace an existing "OldClientName" with "NewClientName" string you can use the same exact steps as listed above but with a modified parameter.

To check/test/verify changes:
Bash:
./nvramCustomClientList.sh modify "OldClientName" "NewClientName"

To commit changes after you're happy with the results above:
Bash:
./nvramCustomClientList.sh docommit modify "OldClientName" "NewClientName"


CAVEAT:
The script currently does not check for valid chars used in "NewClientName" string so it's up to you to use valid chars: alphanumeric, hyphen (-), underscore (_) & period (.) are the ones I prefer to use. Anything else may or may not work.

HTH.
 
Last edited:
Many times before I have needed to "clean up" the "custom_clientlist" NVRAM variable because after some client devices are no longer in use (replaced or simply no longer work) the webGUI does not show them, but the old entries were still in NVRAM. This has happened with several ASUS router models (from relatives & friends) that I have helped with maintenance over the years, so I created a custom shell script that I've used many times to delete the obsolete or unwanted entries from the "custom_clientlist" variable.

I have updated this script to be able to modify/replace the client names if you so choose. I also added more error handling and user-friendly messages so it's a bit easier to use.

This script is now available on GitHub:
Bash:
mkdir -m 755 -p /jffs/scripts
curl -kLSs --retry 3 --retry-delay 5 --retry-connrefused  https://raw.githubusercontent.com/Martinski4GitHub/CustomMiscUtils/master/nvramCustomClientList.sh  -o /jffs/scripts/nvramCustomClientList.sh
chmod 755 /jffs/scripts/nvramCustomClientList.sh

The steps that I've used before to delete obsolete entries from "custom_clientlist" are the following:

1) First, make a backup of the current original value (to have it available just in case a restore is necessary or wanted later on):
Bash:
./nvramCustomClientList.sh backup

2) Now, show the current value that lists all the client entries:
Bash:
./nvramCustomClientList.sh show

3) Select the obsolete/unwanted "ClientName" from the available entries shown in step 2, and execute the command to simply test/check/verify the deletion changes:
Bash:
./nvramCustomClientList.sh modify "ClientName" -DELETE-

4) If the results of the temporary changes shown in step 3 are good and everything looks valid & correct, you can now make the change permanent by committing it with the following command:
Bash:
./nvramCustomClientList.sh docommit modify "ClientName" -DELETE-

5) "Rinse & Repeat" steps 2 thru 4 for any other "ClientName" entries you want to delete.


If for some reason you want to go back to the original NVRAM value, you can still restore it with the following command:
Bash:
./nvramCustomClientList.sh restore

However, when you're happy with the final changes and want to remove all temporary files & the backup, use the following command:
Bash:
./nvramCustomClientList.sh doclear


To modify/replace an existing "OldClientName" with "NewClientName" string you can use the same exact steps as listed above but with a modified parameter.

To check/test/verify changes:
Bash:
./nvramCustomClientList.sh modify "OldClientName" "NewClientName"

To commit changes after you're happy with the results above:
Bash:
./nvramCustomClientList.sh docommit modify "OldClientName" "NewClientName"


CAVEAT:
The script currently does not check for valid chars used in "NewClientName" string so it's up to you to use valid chars: alphanumeric, hyphen (-), underscore (_) & period (.) are the ones I prefer to use. Anything else may or may not work.

HTH.
Wow Thanks so much for all this info. I actually spent a couple of hours last night adding each entry that was not showing the correct hostame in /jffs/scripts/dnsmasq.postconf.

I am not very knowlegable on this stuff but I find it so confusing as there seem to be so many ways the hostnames are picked up. I really want to try your script but I have all the names displaying the way I want.

I would like to clear out all the previous names but scared I will mess something up. Maybe I will get brave and try it. I really do appreciate your time and help.
 

Sign Up For SNBForums Daily Digest

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