/etc/resolve.conf resets itself to its own IP

Status
Not open for further replies.

gallyjh

Dabbler
Joined
Jun 6, 2018
Messages
28
Was recently having DNS issues where nothing could be resolved from the freenas shell. Took a look at the /etc/resolve.conf and this is what shows:
Code:
root@freenas:~ # cat /etc/resolv.conf
# Generated by resolvconf
nameserver 192.168.86.2

This seemed odd to me seeing that in the UI it shows:
upload_2018-10-26_11-54-16.png

So I manually entered the values myself in the resolve.conf, and was able to ping and resolve correctly. Rebooted the machine, but the resolve.conf file reverts itself. What's even odder, is that I haven't touched anything in months on Freenas as it had been working smoothly until now. Any advice on this?
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
FreeNAS is going to rebuild resolv.conf on reconfiguration or reboot.

Are you using anything like DHCP that might try to override your supplied values?
 

gallyjh

Dabbler
Joined
Jun 6, 2018
Messages
28
FreeNAS is going to rebuild resolv.conf on reconfiguration or reboot.

Are you using anything like DHCP that might try to override your supplied values?

Right now it pulls a static IP address. I have my Google Wifi router handing out IP's and I've set it to the range of 31-245. I did recently introduce a Unifi Switch to the network when I got my house wired for ethernet. I'm not sure how that would interfere with it. Think it might be something else?
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
It "pulls" a static IP address? That implies you're using DHCP. Regardless of whether you assign an IP address or allow the DHCP server to pull one from a pool, DHCP typically shoves resolver IP addresses at clients. Any chance that your DHCP server is serving up the listed IP address for recursion DNS? Quick check: try looking at another DHCP-assigned device on the network, or check to see if "dhclient" is running on that interface on the FreeNAS box.

It's always best to check the simple stuff first. Incidentally, I'm of the extremely strong opinion that infrastructure devices like a NAS should be wired down, and not reliant on DHCP.
 

gallyjh

Dabbler
Joined
Jun 6, 2018
Messages
28
It "pulls" a static IP address? That implies you're using DHCP. Regardless of whether you assign an IP address or allow the DHCP server to pull one from a pool, DHCP typically shoves resolver IP addresses at clients. Any chance that your DHCP server is serving up the listed IP address for recursion DNS? Quick check: try looking at another DHCP-assigned device on the network, or check to see if "dhclient" is running on that interface on the FreeNAS box.

It's always best to check the simple stuff first. Incidentally, I'm of the extremely strong opinion that infrastructure devices like a NAS should be wired down, and not reliant on DHCP.
I am wired for a static IP, so perhaps I worded it badly above by saying "pulls". Here is the static assignment from with freenas:
upload_2018-10-26_14-1-2.png

The router is setup for DHCP:
upload_2018-10-26_14-10-2.png

It doesn't appear dhclient is running on the FreeNAS box:
Code:
root@freenas:~ # ps ax | grep dhclient
29607  0  S+	 0:00.00 grep dhclient
root@freenas:~ #

Any thoughts?
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Well, that's all good, and no, not really. I can tell you for certain that you should expect that if you change resolv.conf manually, something will stomp on that sooner or later. You can cause this to happen immediately by just updating the nameserver settings from the GUI.

If dhclient or some other system process isn't stomping on it inadvertently, I'm not sure what would cause it to magically change. What's .86.2 in your network?
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Oh that was stupid. It's the FreeNAS box. Sorry for the dumb question. No ideas offhand.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
You should be assigning the static IP in your router not in FreeNAS. And what is that nameserver address listed? Usually the name server is the router's LAN address unless you have something else on your network handling DNS.
 

gallyjh

Dabbler
Joined
Jun 6, 2018
Messages
28
Well, that's all good, and no, not really. I can tell you for certain that you should expect that if you change resolv.conf manually, something will stomp on that sooner or later. You can cause this to happen immediately by just updating the nameserver settings from the GUI.

If dhclient or some other system process isn't stomping on it inadvertently, I'm not sure what would cause it to magically change. What's .86.2 in your network?
86.2 is my FreeNAS box.
 

gallyjh

Dabbler
Joined
Jun 6, 2018
Messages
28
You should be assigning the static IP in your router not in FreeNAS. And what is that nameserver address listed? Usually the name server is the router's LAN address unless you have something else on your network handling DNS.
I'll go ahead and add it to the router, but typically in the past it's always been fine putting the static value in from the client side as long your DHCP wasn't overlapped. In regards to 86.5, that is my Domain Controller/DNS.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
You should be assigning the static IP in your router not in FreeNAS.

No, you really shouldn't. This can result in intermittent connection drops. Do not rely on DHCP for infrastructure your network needs, generally any server or service.

I have a client whose DHCP server disk filled and it stopped serving DHCP, which was very entertaining when his DHCP-assigned "static" IP addresses for ESXi eventually went away and all his storage became invisible, causing all his VM's to freeze. Even I was in awe.
 

gallyjh

Dabbler
Joined
Jun 6, 2018
Messages
28
[SOLVED] For those in the future looking at this thread. I was able to solve it by unchecking the Domain Controller and SMB service to start on boot. I then rebooted, and everything went back to normal.

I think in the mix of trying to solve some AD issue, I may have checked those by accident and it caused this to break.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
[SOLVED] For those in the future looking at this thread. I was able to solve it by unchecking the Domain Controller and SMB service to start on boot. I then rebooted, and everything went back to normal.

I think in the mix of trying to solve some AD issue, I may have checked those by accident and it caused this to break.

Oh! That might make sense. In the event of acting as a domain controller, Samba very much wants to also serve DNS. I don't know the details of how this works on FreeNAS, but for our standalone Samba AD here, it acts as the DNS server for the served subdomain. I wouldn't be shocked if FreeNAS auto-configured to make that work.
 
Status
Not open for further replies.
Top