X

News, tips, partners, and perspectives for the Oracle Solaris operating system

Zones and DNS

Guest Author

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

Join the discussion

Comments ( 3 )
  • guest Monday, July 13, 2009

    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.


  • bernd Tuesday, July 14, 2009

    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?


  • Brian Leonard Tuesday, July 14, 2009

    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.


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.