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()