Windows Dns Adding A Ptr Record
Enhanced photo quality printing and new borderless print features mean your projects will have the refined look you want! Even manage your time with Calendar Creator Express, the address book and mail merge for effortless mailings every time! Easily add them to any project, create slideshows, burn to CD, or resize for your mobile phone. Freeware print shop type programs. Broderbund The Print Shop 21 Deluxe DVD 2.51 GBThe Print Shop 21 Deluxe offers the best in total personal creativity.
-->Syntax
Description
The Add-DnsServerResourceRecordPtr cmdlet adds a specified pointer (PTR) record to a specified Domain Name System (DNS) zone.
In order to create a PTR record, at first need to be created a Reverse DNS zone (read more about the reverse dns zones here). The reverse DNS zone depends on the size of your IP network. In our example we will use an IPv4 /24 network. In the /24 network, you have 255 unique IP addresses. Add a new PTR record and for the name, enter the final digit of the IP address that you’re setting up the reverse record for. In our example, 100. For the Canonical Hostname, enter the domain name. There are two ways to add Host (A) record in Windows DNS Server which are DNS Server Manager and PowerShell. Using DNS Manager. The first way to add Host A record in Windows DNS Server is using DNS manager. To create new A record, browse to the zone name where you will create the record.
PTR resource records support reverse lookup based on the in-addr.arpa domain.PTR records locate a computer by its IP address and resolve the address to the DNS domain name for that computer.
Examples
Example 1: Add a PTR record
Nov 13, 2013 Click on the Create associated pointer (PTR) record and select Add Host. This will display the successful creation of the record. Select OK and bring back the Add Host window in case multiple.
This command adds a type PTR DNS record in the zone named contoso.com.The record maps IP address 192.168.0.17 to the name host17.contoso.com.The command includes the AllowUpdateAny and AgeRecord parameters, and provides a TTL value.Because the command includes the AgeRecord parameter, a DNS server can scavenge this record.
Because of its purpose, a PTR record is sometimes called Reverse DNS Record. The purpose of a PTR record is mostly administrative - it shows an IP is in fact used with a particular domain. SiteGround provides PTR records only on Cloud and Dedicated servers. Even an eighth rack of Exadata needs 54 DNS entries, when you add up the forward and reverse records. If you’re like us, you have a Windows-based DNS server (whether you like it or not). The DNS configuration interface in Windows Server 2008 is pretty nice, but it can be a pain to repeatedly click to add all of the entries needed.
Parameters
Indicates that the DNS server uses a time stamp for the resource record that this cmdlet adds.A DNS server can scavenge resource records that have become stale based on a time stamp.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Indicates that any authenticated user can update a resource record that has the same owner name.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete.
The cmdlet immediately returns an object that represents the job and then displays the command prompt.You can continue to work in the session while the job completes.To manage the job, use the *-Job
cmdlets.To get the job results, use the Receive-Job cmdlet.
For more information about Windows PowerShell background jobs, see about_Jobs.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Runs the cmdlet in a remote session or on a remote computer.Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet.The default is the current session on the local computer.
Type: | CimSession[] |
Aliases: | Session |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies a DNS server.If you do not specify this parameter, the command runs on the local system.You can specify an IP address or any value that resolves to an IP address, such as a fully qualified domain name (FQDN), host name, or NETBIOS name.
Type: | String |
Aliases: | Cn |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies part of the IP address for the host.You can use either an IPv4 or IPv6 address.For example, if you use an IPv4 class C reverse lookup zone, then Name specifies the last octet of the IP address.If you use a class B reverse lookup zone, then Name specifies the last two octets.
Type: | String |
Aliases: | RecordName |
Position: | 2 |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Returns an object representing the item with which you are working.By default, this cmdlet does not generate any output.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Download aplikasi for laptop. Specifies an FQDN for a resource record in the DNS namespace.This value is the response to a reverse lookup using this PTR.
Type: | String |
Position: | 3 |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Specifies the maximum number of concurrent operations that can be established to run the cmdlet.If this parameter is omitted or a value of 0
is entered, then Windows PowerShell速 calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer.The throttle limit applies only to the current cmdlet, not to the session or to the computer.
Type: | Int32 |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the Time to Live (TTL) value, in seconds, for a resource record.Other DNS servers use this length of time to determine how long to cache a record.
The Start of Authority (SOA) record defines the default TTL.
Type: | TimeSpan |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Specifies the virtualization instance in which the zone will be added.A virtualization instance is logical partition in a DNS Server, which is capable of independently hosting zones and zone scopes.Same name zones and zone scopes can be hosted in different virtualization instances.This parameter is optional and if not provided it will add the zone into the default virtualization instance which is functionally equivalent to a standard DNS server.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs.The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the name of a reverse lookup zone.
Type: | String |
Position: | 1 |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Specifies the name of a zone scope.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Inputs
System.Management.ManagementBaseObject
Outputs
Microsoft.Management.Infrastructure.CimInstance#DnsServerResourceRecord
The DnsServerResourceRecord object contains the following fields:
- DistinguishedName
- HostName
- RecordClass
- RecordData
- RecordType
- Timestamp
- TimeToLive
- PtrDomainName
This blog post has a companion video created by TechSnips contributor, David Lamb. Feel free to have a watch or, if you prefer text, read on!
Viewing DNS Records
You can view all of the resource records for a given DNS zone by simply using the PowerShellGet-DnsServerResourceRecord
cmdlet. Using this cmdlet, you can specify the ZoneName
parameter which will list all DNS records in that zone.
As you can see below, this generates quite a lengthy list of records.
PS51> Get-DnsServerResourceRecord -ZoneName corp.ad
This behavior highlights one of the advantages of this particular cmdlet over the graphical DNS console. The view gives you all of the records for this zone, regardless of which folder they are in. In the graphical console, it would take quite some time to piece this information together.
Create Reverse Dns Ptr Record
Now thin out this list a bit. Using the same cmdlet, but adding the RRType
parameter to search for A records (IPv4 hosts) and filtering for records where the Time To Live (TTL) is greater than 15 minutes gives us a bit more of a manageable list. You can use the Where-Object
cmdlet to filter on many different DNS record properties.
Ptr Dns Record Type
PS51> Get-DnsServerResourceRecord -ZoneName corp.ad -RRType A Where-Object TimeToLive -GE '00:15:00'
Taking this one step further, you can also search for records in a different DNS zone and even on different DNS servers.
In the example below, we will search for A records in the canada.corp.ad zone on DNS server DC03
PS51> Get-DnsServerResourceRecord -ComputerName DC03 -ZoneName canada.corp.ad -RRType A
Adding and Removing A Host Records
To add a host record, you will need to use the Add-DnsServerResourceRecordA
cmdlet. In this example below, you need to add a host record for a new printer that you are adding to the network. It will be added to the corp.ad zone with the name reddeerprint01, and it's IP address is 192.168.2.56.
If it turns out that you need to remove a record, perhaps the printer has been decommissioned, you can use the following code to remove the host record that we just created:
PS51> Remove-DnsServerResourceRecord -ZoneName corp.ad -Name reddeerprint01 -RRType A
Adding and Removing AAAA Host Records
It is also just as easy to add an IPv6 host record. Of course, these records differ slightly, as they are listed as AAAA records. You may notice that we are now using the Add-DnsServerResourceRecordAAAA
cmdlet. It's a subtle change, but an important one.
Add a record to the corp.ad zone for the new IT Intranet server at fc00:0128 and then quickly verify that it has been created with the following command.
Adding Reverse Lookup Records (PTR)
Using PowerShell with DNS records, you can also add PTR records. A reverse lookup record allows the client to query a DNS server to request the hostname for a supplied IP address.
Creating a PTR record is a relatively easy process, but there is one important bit of information you will need to know before you start adding PTR records. Reverse lookup zones are not created by default. You will need to set up your reverse lookup zone prior to adding records. Fortunately, it is relatively easy to do.
Creating a DNS Zone
Use the Add-DnsServerPrimaryZone
cmdlet to create a new DNS zone. In this instance, since you're creating a reverse lookup zone, provide it with the Network ID.
In this example, I have also chosen to set the replication scope to the entire AD forest, and I have specifically targeted DC03 as the preferred DNS server:
Now that the reverse lookup zone is in place, you can add a PTR record for a new printer called CYQF-Printer-01.canada.corp.ad that has an IP address of 192.168.2.56. As this record is for the canada.corp.ad zone, you will be targeting the DNS server DC03.
Now that the zone is created, let's create a PTR record using the Add-DnsServerResourceRecordPtr
command. When using this cmdlet, it is important to note a couple of things.
- You need to specify the zone name using the network ID in reverse order, then add .in-addr.arpa. So for our 192.168.2.0/24 network ID, the zone name is 2.168.192.in-addr.arpa.
- The
Name
parameter is the host portion of the IP address. For our printer at 192.168.2.56, theName
is 56.
Once you have those pieces of information, the code required to create the PTR record is relatively simple, if a bit long:
Adding Alias Records (CNAME)
To finish off this tutorial, create a host alias record or CNAME record using the Add-DnsServerResourceRecordCName
cmdlet.
These records allow you to specify an alias for an existing host record in the zone. This becomes especially useful, for example, if you want to provide your finance users with an address for their web-enabled finance app.
You could create an alias called finance, and point it to the web server webapp25.corp.ad. Once the app is migrated to the new web server with a new hostname, you'd then change the CNAME record to point finance that points to the new host. This way, the users don't have to update their bookmarks. They can continue to access their application using the address finance.corp.ad.
Windows Dns Adding A Ptr Record Free
If you'd like to dive deeper into DNS and see some more advanced capabilities, be sure to check out all of the other DNS posts here.
Summary
This concludes our tutorial on using PowerShell with DNS records. With the knowledge you've accumulated here, you should now be able to manage interactively or even automate large swaths of DNS records if you set your mind to it!
If you enjoyed this post, be sure to check out some similar posts on Microsoft DNS
Subscribe to Adam the Automator
Stay up to date! Get all the latest & greatest posts delivered straight to your inbox