1

I have heard that DNS configuration can only be IP address and not host name. How do I configure DNS server in ubuntu machine.

If it should be IP address only then why this configuration shows the host name.

The /etc/resolv.conf says that it is auto-generated and shouldn't be handwritten. 

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
search zebra.global.vpz

I am looking for the equivalent tools in Ubuntu.

Here are the windows networking tools -

1) ipconfig /all - this shows all the things like MAC Address, Adapter name, DHCP lease time, DHCP renew time, DNS server.

What is the equivalent in linux Ubuntu - I understand ifconfig but ifconfig doesn't give that many information.

2) ipconfig/release - this is to release the ip address. what's the equivalent in ubuntu?

3) ipconfig/renew - this is to renew the ip address. What's the equivalent in ubuntu?

4) ipconfig /flushdns - this is to flush the cached dns. What's the equivalent in ubuntu?

5) arp -d to flush the arp cache. What's the equivalent in ubuntu?

0

1) ipconfig /all - this shows all the things like MAC Address, Adapter name, DHCP lease time, DHCP renew time, DNS server.

First, you need to find the newest .lease file. It will either be in /var/lib/dhcp or /var/lib/NetworkManager. You can find it with

ls -lhatr /var/lib/dhcp
ls -lhatr /var/lib/NetworkManager

The newest is the one closest to the bottom.

Once you have it, this is very long but the following combination can return all of that:

 ifconfig | grep -A 2 <interface-name> && cat /etc/resolv.conf && cat /var/lib/NetworkManager/dhclient-5d4f3196-e584-4988-b01d-99f087bfcb54-ens33.lease | grep -e dhcp-server -e renew -e rebind -e expire

Replace <interface-name> with whatever interface is receiving the address via dhcp and the /var/lib file ending in .lease will be whichever file is the newest from the previous ls -lhatr command.

2) ipconfig/release - this is to release the ip address. what's the equivalent in ubuntu?

ifdown <interface-name>

3) ipconfig/renew - this is to renew the ip address. What's the equivalent in ubuntu?

ifup (interface-name>

4) ipconfig /flushdns - this is to flush the cached dns. What's the equivalent in ubuntu?

systemd-resolve --flush-caches

5) arp -d to flush the arp cache. What's the equivalent in ubuntu?

ip -s -s neigh flush all
  • 1
    I get "/all: error fetching interface information: Device not found" – Geoffrey Anderson Jan 31 at 19:51
  • 2
    @GeoffreyAnderson ipconfig /all is the command on Windows, not linux. That part of my answer is just referencing the Windows command before providing what he is looking for in Linux. You should take that into account and read the question before trying to use a Windows command in Linux and voting on an answer. – Nasir Riley Feb 6 at 12:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.