Use license for staging, test and production

How to use single license for staging, test and production server. Please provide steps for it and which file and folder do i need to create

A license is only valid for a single domain. For test and staging you don’t need a license.

if we don’t have license for staging and test , it will also show pls register. going ahead it will block our staging or affect on anything?

Also i am following below approach to use same license for staging and production server where my config.php contains same license. is this approach will work? If i am wrong please suggest me correct way

Folder structure:

multisites
   domain1.com
         config
              config.php
   domain2.com
         config
              config.php
   domain3.com
         config
              config.php

config.php
<?php

c::set('license', 'my-licnse-key');