Announcement

Collapse
No announcement yet.

Cannot set DNS Servers for Z-Net with Static Network Config

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Cannot set DNS Servers for Z-Net with Static Network Config

    Hello all,

    Have had a Z-Net for a few years now and at first I had it configured for DHCP using a static reservation. A couple years ago I changed the network config on the Z-Net to static. To this day, the /etc/resolv.conf file has the DNS server that was handed out by DHCP all those years ago and I have no way to change it. I am unable to change the network config back to DHCP (either by choosing the DHCP button in the Web GUI, or clearing the network config in the Web GUI, or by using the Reset Network script). No matter what I do, I retain the static network config and that old DNS server (which is no longer active). I am running v1.0.22 on my Z-Net.

    I'd rather not do any serious hacking, but at this point I'm thinking of editing /etc/resolv.conf and setting the immutable bit on it. This leaves me with an unsupported config I'm sure, but there doesn't seem to be any way around this.

    Is there some magic incantation to changing the DNS server or to setting back to DHCP from static? Or should it Just Work(TM)?

    Thanks.

    #2
    I would just go ahead and hack it. This is a fundamental flaw in the Z-Net implementation. Support in this area is weak.

    As you are running 1.0.22, I surmise this is a V1 Z-Net? Post contents of /etc/network/interfaces if you want to try to diagnose the issue. Otherwise, editing /etc/resolv.conf should fix the DNS issue.
    Last edited by zwolfpack; September 18, 2018, 12:50 PM.

    Comment


      #3
      Attaching a keyboard and resetting the network settings didn't work? Is that what you are referring to with the reset network script?

      Comment


        #4
        Thanks for the replies. I'm assuming I have a v1 Z-Net since I got one soon after they came out. :-) As for /etc/network/interfaces, here's what it looks like:

        auto lo
        iface lo inet loopback
        allow-hotplug eth0
        iface eth0 inet static
        address 192.168.100.129
        netmask 255.255.255.0
        gateway 192.168.100.100

        allow-hotplug wlan0
        iface wlan0 inet dhcp
        wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

        Notice that it does not define a name server or a domain suffix search. I've tried adding lines for both, but they don't stick through a reboot.

        As for the reset script, I haven't done the keyboard/monitor thing (my Z-Net is in an inconvenient place for that), but I've run the script from a shell and pressed "r" at the appropriate time. The script appears to finish running and then reboots the Z-Net. It's possible a keyboard/monitor would actually work, but honestly, I'd rather hack the resolv.conf file at that point. But that's just me.

        Thanks!

        Comment


          #5
          The interfaces file looks as expected for a static address.

          "but they don't stick through a reboot" - this is troubling. I wonder if you are having SD card issues.

          One option is to upgrade to the V2 SD image. This runs fine on the older V1 hardware.

          Comment


            #6
            I'm pretty sure the not sticking has something to do with a script somewhere overwriting that file. I thought it was /var/www/Main/Configure.sh, so I modified it to add the name server and search suffix, but even that doesn't stick. Both the interfaces and Configure.sh files are shiny and new upon reboot, like they're being recreated/restored each reboot. Probably the Configure.sh is being restored from somewhere (creation date goes back to Aug 30 2016) each reboot and it, or some other script, is recreating the interfaces file (creation time Jan 11 1970 23:58).

            I've done some digging, but I can't find the script that is restoring Configure.sh. That immutable bit is looking better and better though it's a heck of a kludge.

            Comment


              #7
              Very odd. There's nothing in the standard Z-Net distribution that should cause that. Its almost like its running out of a RAM disk...

              It is a really old OS version though. Maybe try creating some test files and see if they stick. Also, try 'sudo sync' before rebooting.

              Comment

              Working...
              X