Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在 Ubuntu 中创建 DNS,有时我必须使用 dig 命令(我正在使用 test=system("dig www.google.com") 如何从 dig 命令的返回中获取 IPv4给他们能用吗?
您的意思是“进行 DNS 查找”吗?如果是这样,请尝试函数gethostbyname和gethostbyaddr。这比dig.
gethostbyname
gethostbyaddr
dig
还是您特别想要输出dig?如果是这样,请使用popen().
popen()