Can't resolve hostnames within my jails

zimon

Contributor
Joined
Jan 8, 2016
Messages
134
Hello,

I recently moved my freenas to a different network and therefore I had to change the ip adresses of all my jails (from 192.168.188.x to 192.168.1.x)

Unfortunalty I can't ping any internet adress anymore within any of my jails.
When I try
ping google.com
I get
ping: cannot resolve google.com: Host name lookup failure

Pinging 8.8.8.8 works fine.

Anyone any ideas?
 
D

dlavigne

Guest
Does netstat -rn within the jail show the correct default gateway?
 

zimon

Contributor
Joined
Jan 8, 2016
Messages
134
no it didn't.
I am stupid.

I changed it in /etc/resolve.conf

it works now
 
D

dlavigne

Guest
I assume you mean /etc/rc.conf for the gateway, so you won't be disappointed at next boot :smile:
 

Ixian

Patron
Joined
May 11, 2015
Messages
218
I think /etc/rc.conf is just the default fallback, sounds like @zimon doesn't have the gateway/dns configured correctly in the GUI: Network>Global Configuration. Those are stored in the Freenas config db, which over-write default.conf values if the values are present in it. That's the better way to do it I think.

Changes to /etc/resolv.conf inside the jail itself will, as @dlavigne pointed out, reset on next boot.
 

zimon

Contributor
Joined
Jan 8, 2016
Messages
134
I think /etc/rc.conf is just the default fallback, sounds like @zimon doesn't have the gateway/dns configured correctly in the GUI: Network>Global Configuration. Those are stored in the Freenas config db, which over-write default.conf values if the values are present in it. That's the better way to do it I think.

Changes to /etc/resolv.conf inside the jail itself will, as @dlavigne pointed out, reset on next boot.
thanks, you are right, those settings are not set.

since my gateway (my router on 196.168.1.1) is already configured to use 1.1.1.1 as a nameserver should I put 196.168.1.1 in all settings in the GUI>network>Global configuration?
For ipv4 gateway and nameserver?
 

Ixian

Patron
Joined
May 11, 2015
Messages
218
Yes, that's generally the way to do it if you have DNS resolving set up on your router; assuming that is the DNS all your other devices use then your Freenas server should be consistent with them. You can always add a secondary DNS to Freenas as a backup. If you do any kind of network ad blocking (like a Pi-hole, or PFBlockerNG with pfsense, etc.) then you always want to just use it.

By the way if you've never looked in to it consider a network-wide adblocker, they are pretty awesome. Different topic though.
 

zimon

Contributor
Joined
Jan 8, 2016
Messages
134
By the way if you've never looked in to it consider a network-wide adblocker, they are pretty awesome. Different topic though.

Thats anawesome idea :) will set it on my todo list :)
 
Top