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
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 192.18.1.36 on July 14, 2009 at 06:59 AM 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 07: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 02:03 PM GMT #