Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/Network/DNS Hostname IP
Function:
Required plugins for this example: MBS Network Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Network/DNS Hostname IP
This example is the version from Tue, 8th Apr 2013.
Project "DNS Hostname IP.rbp"
Class Window1 Inherits Window
Control List Inherits Listbox
ControlInstance List Inherits Listbox
End Control
EventHandler Sub Open() dim ip as string // you can put here your IP and see what it is reverse dim name as string = DNSAddressToNameMBS("91.37.67.178") List.AddRow "91.37.67.178", name, "IPv4" if name<>"" then List.AddRow name, DNSNameToAddressMBS(name), "IPv4" List.AddRow name, DNSNameToAddressIPv6MBS(name), "IPv6" end if // try localhost List.AddRow "127.0.0.1", DNSAddressToNameMBS("127.0.0.1"), "IPv4" List.AddRow "::1", DNSAddressToNameIPv6MBS("::1"), "IPv6" List.AddRow "localhost", DNSNameToAddressMBS("localhost"), "IPv4" List.AddRow "localhost", DNSNameToAddressIPv6MBS("localhost"), "IPv6" // now try a few websites forwards and backwards ip = DNSNameToAddressMBS("www.realbasic.com") List.AddRow "www.realbasic.com", ip, "IPv4" if ip<>"" then List.AddRow ip, DNSAddressToNameMBS(ip), "IPv4" end if ip = DNSNameToAddressIPv6MBS("www.realbasic.com") List.AddRow "www.realbasic.com", ip, "IPv6" if ip<>"" then List.AddRow ip, DNSAddressToNameIPv6MBS(ip), "IPv6" end if ip = DNSNameToAddressMBS("www.google.com") List.AddRow "www.google.com", ip, "IPv4" if ip<>"" then List.AddRow ip, DNSAddressToNameMBS(ip), "IPv4" end if ip = DNSNameToAddressIPv6MBS("www.google.com") List.AddRow "www.google.com", ip, "IPv6" if ip<>"" then List.AddRow ip, DNSAddressToNameIPv6MBS(ip), "IPv6" end if ip = DNSNameToAddressMBS("www.apple.com") List.AddRow "www.apple.com", ip, "IPv4" if ip<>"" then List.AddRow ip, DNSAddressToNameMBS(ip), "IPv4" end if ip = DNSNameToAddressIPv6MBS("www.apple.com") List.AddRow "www.apple.com", ip, "IPv6" if ip<>"" then List.AddRow ip, DNSAddressToNameIPv6MBS(ip), "IPv6" end if End EventHandler
End Class
MenuBar Menu
MenuItem UntitledMenu3 = ""
MenuItem UntitledMenu2 = "File"
MenuItem FileQuit = "Quit"
MenuItem UntitledMenu0 = "Edit"
MenuItem EditUndo = "Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cut"
MenuItem EditCopy = "Copy"
MenuItem EditPaste = "Paste"
MenuItem EditClear = "Clear"
End MenuBar
Class App Inherits Application
End Class
End Project

See also:

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS Network Plugin.




Links
MBS Xojo PDF Plugins