0

I'm configuring my IP statically, but I cannot reach the DNS.

I have a static IP, and I can ping my default gateway and any external ips.

In /etc/resolv.conf, I've set the content the same as when it's working when set up dynamically with "ifconfig eth0 up" :

search def.abcd.ca
nameserver 123.45.6.789

But with a static IP, DNS is unreachable.

What could prevent me from having dns to be reachable ?

1
  • 123.45.6.789 is not a valid IPv4 address since they need to be 4 bytes, which is not the case of 789. What do you gain by obfuscating things, especially with invalid values? Apr 29, 2017 at 15:20

2 Answers 2

0

Do you have NetworkManager or network running? try systemctl status NetworkManager or systemctl status network. If you are using NIS, then systemctl status ypbind. Replace status with start and see if any logs appear in your system logs.

4
  • systemctl status network-manager : active. systemctl status networking : active, (I have no ypbind).
    – trogne
    Apr 27, 2017 at 17:57
  • 1
    Different files for configuring DNS when using NetworkManager see this link
    – RobbieTheK
    Apr 27, 2017 at 18:18
  • I'm trying, not working yet...
    – trogne
    Apr 27, 2017 at 19:55
  • It is only working with network-manager and dhcp.
    – trogne
    Apr 27, 2017 at 20:02
0

Thanks to @RobbieTheK.

NetworkManager needed to be disabled : systemctl stop NetworkManager

With network manager disabled, two ways to configure manually a connection :

1- In /etc/network/interfaces, then turn on/off the interface with ifup/ifdown

2- By single commands : ifconfig eth0... to add the ip ; route add ... to add the default gateway. And look for the DNS in /etc/resolv.conf.

If you want to manually set a connection, with network manager enabled, you need to set "managed=true" in "etc/NetworkManager/NetworkManager.conf".

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .