Get default gateway in java

后端 未结 5 1632
旧巷少年郎
旧巷少年郎 2020-12-19 05:30

I want to fetch default gateway for local machine using java. I know how to get it by executing dos or shell commands, but is there any another way to fetch? Also need to fe

5条回答
  •  Happy的楠姐
    2020-12-19 05:49

    There is currently no standard interface in Java to obtain the default gateway or the DNS server addresses. You will need a shell command.

提交回复
热议问题