When you need to access value from nested Hash, it’s better to use dig method. Without dig you have to do nil checking to prevent error.

names = {domains: {blogs: ['kaklabs.com', 'railsmine.net'], tools: 'tools.kaklabs.com'}}
# => {:domains=>{:blogs=>["kaklabs.com", "railsmine.net"], :tools=>"tools.kaklabs.com"}}

names[:domains][:tools]
# => "tools.kaklabs.com"

ames.dig(:domains, :tools)
# => "tools.kaklabs.com"

names[:random][:tools]
# in `<main>': undefined method `[]' for nil:NilClass (NoMethodError)
# from /home/example/.rvm/rubies/ruby-3.1.1/lib/ruby/gems/3.1.0/gems/irb-1.4.1/exe/irb:11:in `<top (required)>'
# from /home/example/.rvm/rubies/ruby-3.1.1/bin/irb:25:in `load'
# from /home/example/.rvm/rubies/ruby-3.1.1/bin/irb:25:in `<main>'

names.dig(:random, :tools)
# => nil