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 ?

trogne
  • 141
  • 1
  • 8
  • 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? – Patrick Mevzek Apr 29 '17 at 15:20

2 Answers2

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.

RobbieTheK
  • 390
  • 5
  • 15
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".

trogne
  • 141
  • 1
  • 8