Tag: dns

News: Oracle to buy DNS, cloud infrastructure provider Dyn

News: Oracle to buy DNS, cloud infrastructure provider Dyn

http://www.networkworld.com/article/3143220/cloud-computing/oracle-to-buy-dns-cloud-infrastructure-provider-dyn.html

Advertisements
PS: Changing NIC IP Configuration

PS: Changing NIC IP Configuration

Okay, so it’s taken me a fair while of time to get this script to work needed for one of my latest projects so due to it taking me a while to piece this together I feel that it’s probably worthwhile putting it out on here for you guys to use if you wish. The following code will change the IP of a NIC and reconfigure the DNS settings using NETSH

 <# Get Network Adapter #>
Get-NetAdapter | Format-Table -AutoSize
<# User Input Network Interface #>
write-host 'Please Enter Network Interface Name: ' -ForegroundColor Yellow -NoNewline
$nicname = Read-Host
Write-host 'Please Enter New Host IP: ' -ForegroundColor Yellow -NoNewline
$NewIP = Read-Host
Write-host 'Please Enter New Subnet Mask: ' -ForegroundColor Yellow -NoNewline
$NewMask = Read-Host
Write-Host 'Please Enter New Gateway: ' -ForegroundColor Yellow -NoNewline
$NewGate = Read-Host
Write-Host 'Please Enter DNS Server 1: ' -ForegroundColor Yellow -NoNewline
$NewDNS1 = Read-Host
Write-Host 'Please Enter DNS Server 2:' -ForegroundColor Yellow -NoNewline
$NewDNS2 = Read-Host
write-host 'Setting New IPv4 Configuration'
& "$env:windir\system32\netsh.exe" interface ipv4 set address $nicname static $NewIP $NewMask $NewGate
write-host 'Removing Exsisting DNS Config'
& "$env:windir\system32\netsh.exe" interface ip delete dns $nicname all
write-host 'Adding New DNS Config'
& "$env:windir\system32\netsh.exe" interface ipv4 set dns name=$nicname source=static address=$NewDNS1 primary validate=no
& "$env:windir\system32\netsh.exe" interface ipv4 add dnsserver name=$nicname address=$NewDNS2 index=2 validate=no