Share via


Can DNSServer Powershell module cmdlets be used to add a host record with a blank name? i.e. "(same as parent folder)"

Question

Monday, December 8, 2014 5:47 AM

Giving Add-DnsServerResourceRecordA a blank name yields an error (basically saying that the 'Name' parameter cannot be null or empty). In DNS Manager (dnsmgmt.msc) adding such a host record yields a record with the same name as the parent folder, denoted by "(same as parent folder)" in the Name column.

Is there some flag I can pass to Add-DnsServerResourceRecordA to achieve the latter functionality? Is there some other way to achieve this in Powershell?

I currently have the line of PS below, and if $name="" I get the error.

Add-DnsServerResourceRecordA -IPv4Address $ip -ZoneName $zone -Name $name -ComputerName $dns

All replies (2)

Monday, December 8, 2014 12:53 PM âś…Answered | 1 vote

Hi,

I believe below command should work for same as parent records.

add-dnsserverresourcerecord -Zonename $zone -A -ipv4address $ip -name "." -computername $dns

Regards,

Calin


Monday, December 8, 2014 9:40 PM

Thanks, Calin!

This could be added as an example here: http://technet.microsoft.com/en-us/library/jj649925.aspx

Now that I see your answer Example 6 looks like it was supposed to use -Name "." but part of the line is missing so it just looks broken instead.