Cara Mengecheck DNS kita menggunakan Visual Basic 6.0, Cara Mengetahui DNS kita tanpa software, Cara Melihat DNS kita menggunakan software dengan mudah, cepat dan gampang
Bahan Bahan :- TextBox
- Visual Basic 6.0 [ Download VB 6 Disini ]
Tutorial :
1. Letakan TextBox Bernama : MyDNS
2. Masukan Code Berikut Ke Form1 ( Double Klik Pada Form1 / Klik Kanan View Code )
Function DetectDNSServer() As String
Dim Output As String
On Error GoTo ErrHandler
Set objShell = CreateObject("WScript.Shell")
Set objExecObject = objShell.Exec("%comspec% /c ipconfig /all")
Output = objExecObject.StdOut.ReadAll()
Set objExecObject = Nothing
DNS = Trim(Replace(Mid(Output, InStr(InStr(1, Output, "DNS Servers"), Output, ":") + 1, 15), Chr(13),""))
DetectDNSServer = DNS
Exit Function
ErrHandler:
DetectDNSServer = "127.0.0.1"
End Function
Private Sub Form_Load()
MyDNS.Text = DetectDNSServer
End Sub