# DNS This document explains how to get started using Azure DNS Service with Fog. ## Usage First of all, you need to require the Fog library by executing: ```ruby require 'fog/azurerm' ``` ## Create Connection Next, create a connection to the DNS Service: ```ruby fog_dns_service = Fog::DNS::AzureRM.new( tenant_id: '', # Tenant Id of Azure Active Directory Application client_id: '', # Client Id of Azure Active Directory Application client_secret: '', # Client Secret of Azure Active Directory Application subscription_id: '', # Subscription Id of an Azure Account environment: '' # Azure cloud environment. Default is AzureCloud. ) ``` ## Check Zone Existence ```ruby fog_dns_service.zones.check_zone_exists('', '') ``` ## Create Zone Create a new Zone ```ruby fog_dns_service.zones.create( name: '', resource_group: '', tags: { key: 'value' # [Optional] } ) ``` ## List Zones ```ruby fog_dns_service.zones.each do |zone| puts "#{zone.name}" puts "#{zone.resource_group}" end ``` ## Retrieve a single Zone Get a single record of Zone ```ruby zone = fog_dns_service .zones .get('', '') puts "#{zone.name}" ``` ## Destroy a single Zone Get Zone object from the get method(described above) and then destroy that Zone. ```ruby zone.destroy ``` ## Check Record Set Existence ```ruby fog_dns_service.record_sets.check_record_set_exists('', '', '', '') ``` ## Create Record Set Create a new Record Set ```ruby fog_dns_service.record_sets.create( name: '', resource_group: '', zone_name: '', records: '', type: '', ttl: ) ``` ## List Record Sets ```ruby fog_dns_service.record_sets( resource_group: '', zone_name: '' ).each do |record_set| puts "#{record_set.name}" puts "#{record_set.resource_group}" end ``` ## Retrieve a single Record Set Get a single record of Record Set ```ruby record_set = fog_dns_service .record_sets .get('', '', '', '') puts "#{record_set.name}" ``` ## Update TTL Get an object of record set and then update TTL ```ruby record_set.update_ttl(ttl: