오늘 아침 Douzi는 우연히 회사의 DNS 서버에 순방향 해상도만 있고 해당 PTR 레코드가 없다는 사실을 발견했습니다. 즉, IP 주소는 도메인 이름을 통해 확인할 수 있지만, IP 주소를 거꾸로 하면 도메인 이름을 찾을 수 없습니다.
기존 레코드에 해당하는 리버스 존과 PTR 레코드가 있는지 확인하는 매우 간단한 스크립트를 1시간 만에 작성했습니다. 그렇지 않은 경우 자동으로 생성해 드립니다.
아이디어는 매우 간단하고, 스크립트도 비교적 거칠지만, 내결함성 처리나 최적화는 없지만 기능을 구현하는 것은 좋습니다.
$ptrzones=Get-DnsServerzone -ComputerName syddc01 | Where-Object {$_.zonename -like "*.arpa"} #获取所以的A记录 $machines=Get-DnsServerResourceRecord -ComputerName syddc01 -RRType A -ZoneName 'omnicom.com.au'| select @{n='IP';e={$_.recorddata.IPV4Address.IPAddressToString}}, hostname, timestamp, @{n='PTRZone';e={$temp=$_.recorddata.IPV4Address.IPAddressToString.split('.');$t=$temp[2]+'.'+$temp[1]+'.'+$temp[0]+‘.in-addr.arpa’;$t}} foreach($machine in $machines){ #判断是否存在PTR的reverse zone write-host $machine.hostname write-host $machine.PTRZone $flag=0 foreach($p in $ptrzones){ if($p.zonename -eq $machine.PTRZone){ #write-host " Matched PTR Zone" -BackgroundColor Cyan $flag=1 break } } #如果PTR Zone不存在,创建一个对应的 if($flag -eq 0){ write-host " PTRZone is Missing,A new PTRZone will be created" -ForegroundColor Red $temp=$machine.IP.Split('.') $range=$temp[0]+'.'+$temp[1]+'.'+$temp[2]+".0/24" #$range Add-DnsServerPrimaryZone -DynamicUpdate Secure -NetworkId $range -ReplicationScope Domain -ComputerName syddc01 } else{ #如果PTR zone存在,判断是否存在对应的PTR记录 $hname=Get-DnsServerResourceRecord -ComputerName syddc01 -RRType Ptr -ZoneName $machine.PTRZone | select @{n='name';e={$_.recorddata.ptrdomainname}} #$hname $temp="*"+$machine.hostname+"*" if($hname -like $temp){ Write-Host "Already exist" -ForegroundColor Cyan } else{ #PTR Zone存在 但是PTR记录不存在 Write-Host "Adding PTR record" -ForegroundColor Yellow Add-DnsServerResourceRecordPtr -ComputerName syddc01 -ZoneName $machine.PTRZone -Name $machine.IP.Split('.')[3] -AllowUpdateAny -TimeToLive 01:00:00 -AgeRecord -PtrDomainName $machine.hostname } } }
스크립트 실행
결과

핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

AI Hentai Generator
AI Hentai를 무료로 생성하십시오.

인기 기사

뜨거운 도구

VSCode Windows 64비트 다운로드
Microsoft에서 출시한 강력한 무료 IDE 편집기

mPDF
mPDF는 UTF-8로 인코딩된 HTML에서 PDF 파일을 생성할 수 있는 PHP 라이브러리입니다. 원저자인 Ian Back은 자신의 웹 사이트에서 "즉시" PDF 파일을 출력하고 다양한 언어를 처리하기 위해 mPDF를 작성했습니다. HTML2FPDF와 같은 원본 스크립트보다 유니코드 글꼴을 사용할 때 속도가 느리고 더 큰 파일을 생성하지만 CSS 스타일 등을 지원하고 많은 개선 사항이 있습니다. RTL(아랍어, 히브리어), CJK(중국어, 일본어, 한국어)를 포함한 거의 모든 언어를 지원합니다. 중첩된 블록 수준 요소(예: P, DIV)를 지원합니다.

맨티스BT
Mantis는 제품 결함 추적을 돕기 위해 설계된 배포하기 쉬운 웹 기반 결함 추적 도구입니다. PHP, MySQL 및 웹 서버가 필요합니다. 데모 및 호스팅 서비스를 확인해 보세요.

WebStorm Mac 버전
유용한 JavaScript 개발 도구

ZendStudio 13.5.1 맥
강력한 PHP 통합 개발 환경
