donderdag 14 januari 2016

Add DNS record with powershell

Add-DnsServerResourceRecordA -Name "TEST.TEST1.TEST1" -ZoneName "zone_name.local" -IPv4Address "10.0.0.1" -TimeToLive 00:15:00

This adds a A record in DNS under zone zone_name.local and the structure will be test.test1.test1.zone_name.local

Add-DnsServerResourceRecordCName -Name "TEST.TEST1.TEST1" -HostNameAlias "TEST.TEST1.TEST1" -ZoneName "zone_name" -TimeToLive 00:15:00

This adds a CNAME record in DNS under zone zone_name.local and the structure will be test.test1.test1.zone_name.local

Muliple Ip's on 1 interface register multiple DNS records

If you don’t want to register the extra ip addresses in DNS you simply can avoid this by adding the extra ip addresses with NETSH and the flag skipassource=true

netsh int ipv4 add address "Local Area Connection" address=10.0.0.1 mask=255.255.255.0 skipassource=true