SOLVED Wrong nameserver in jails

Status
Not open for further replies.

nasuser12

Dabbler
Joined
Feb 21, 2014
Messages
14
Hi all,

I'm having some problems with my jails. Everything was working correctly until I found I could not connect to most sites from within some of my jails. I appears that the nameservers (DNS) are setup incorrectly within these jails. I cannot ping www.google.com, but can ping its ip addresses. Outside my jails everything is fine and I can ping both ip addresses and urls.

I cannot find where I can set the nameserver for jails. Does anyone know?

Some details:
Of my 9 jails (2 portjails and 7 pluginjails), 5 appear to not be able to do name server lookup.
My modem's ip address is 192.168.178.1 and this is set as my default gateway in Freenas. The ip-addresses of my jails are not used by other devices in my network. Any help is greatly appreciated!

Best regards!

Code:
[root@freenas] ~# cat /etc/resolv.conf
search local
nameserver 192.168.178.1
nameserver 8.8.8.8
nameserver 8.8.4.4
[root@freenas] ~# nslookup www.google.com
Server:     8.8.8.8
Address:   8.8.8.8#53

Non-authoritative answer:
Name:   www.google.com
Address: 74.125.136.106
Name:   www.google.com
Address: 74.125.136.105
Name:   www.google.com
Address: 74.125.136.103
Name:   www.google.com
Address: 74.125.136.99
Name:   www.google.com
Address: 74.125.136.147
Name:   www.google.com
Address: 74.125.136.104


Code:
root@customplugin_1:/ # cat /etc/resolv.conf
search local
nameserver 213.51.129.37
nameserver 213.51.144.37
nameserver 83.80.1.236

root@customplugin_1:/ # nslookup www.google.com
;; Got recursion not available from 83.80.1.236, trying next server
;; connection timed out; no servers could be reached
 
D

dlavigne

Guest
If the jail was created with vimage, it has its own networking stack, meaning you have to set up DNS in the jail's /etc/resolv.conf and its default gateway in /etc/rc.conf. Any particular reason why the DNS server IPs are different in the jail? e.g. 8.8.8.8 should work, assuming the jail has a default gateway.
 

nasuser12

Dabbler
Joined
Feb 21, 2014
Messages
14
Manually changing the DNS server ip addresses using vi solved the problem! I still have no idea how and why they were changed from their original ones, but it all functions correctly now.
 

nemo1478

Dabbler
Joined
May 5, 2015
Messages
43
But what happens when you restart the jail or reboot FreeNAS? Does the DNS info you added remain?
 
D

dlavigne

Guest
In the jail, yes, as it is stored in the jail itself and is not stored in the FreeNAS config database.
 

nemo1478

Dabbler
Joined
May 5, 2015
Messages
43
Great! I applied this fix to a problem I was having and now all my issues have been resolved. Thank you.
 
Status
Not open for further replies.
Top