Zones and DNS

If you've preconfigured your zone as I did, you will probably be frustrated that there's no DNS. For example:

root@myzone:~# pkg search glassfish
pkg: Some servers failed to respond appropriately:
    http://pkg.opensolaris.org/release/: node name or service name not known

This is easy enough to fix. First, copy the global zone's /etc/resolve.conf file to myzone:

bleonard@opensolaris:~$ pfexec cp /etc/resolv.conf /zones/myzone/root/etc/.

Then, in the zone, copy /etc/nsswitch.dns to /etc/nsswitch.conf:

root@myzone:~# cp /etc/nsswitch.dns /etc/nsswitch.conf

And you're all set:

root@myzone:~# pkg search glassfish
INDEX      ACTION    VALUE                     PACKAGE
description set       GlassFish                 pkg:/glassfishv2@0.5.11-0.86
description set       GlassFish                 pkg:/glassfishv2@0.5.11-0.86
description set       GlassFish                 pkg:/glassfishv2@0.5.11-0.86
description set       GlassFish                 pkg:/web/glassfish-2@2.1-0.111

Comments:

The better way would be to configure DNS in the zone using the sysidcfg file you used before. Add something along the lines of

name_service=DNS {domain_name=west.arp.com name_server=10.0.1.10,10.0.1.20 search=arp.com,east.arp.com}

instead of name_service=NONE and you should be golden.

Posted by guest on July 13, 2009 at 11:59 PM GMT #

shouldn't sysidconfig get run when you start the zone for the first time anyway (use zlogin -C to configure nameservice and co)?
or is this different on opensolaris?

Posted by bernd on July 14, 2009 at 12:08 AM GMT #

Setting the name_service keyword to DNS in the sysidcfg file caused an error that then caused the interactive configuration tool to start. I should probably file an issue.

@bernd - yes, if using the interactive configuration tool DNS sets up just fine. It was using the preconfiguation where I had troubles setting up DNS.

Posted by Brian Leonard on July 14, 2009 at 07:03 AM GMT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

The Observatory is a blog for users of Oracle Solaris. Tune in here for tips, tricks and more as we explore the Solaris operating system from Oracle.

Connect with Oracle Solaris:


Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today