[英]How can I get the IP of a hostname using a fixed DNS server?
Is there an easy way, on *nix platforms(Linux specifically) to get the IP address of a hostname, while supplying a custom DNS server to use in place of the system's configured one? 在* nix平台(特别是Linux)上,是否有一种简单的方法来获取主机名的IP地址,同时提供自定义DNS服务器以代替系统已配置的DNS服务器? I want to access this information from a C program.
我想从C程序访问此信息。
nslookup <hostname> <dns server>
例如:
nslookup www.example.com ns1.example.com
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.