0

I'm trying to setup my 4 network interfaces to have a specific dns-nameservers and dns-search so I can be connected to my domain using any of them but it's not working properly as when I run systemctl restart networking.service it keeps loading but never works. It will only works if I set only one so I am doing something wrong but not sure what exactly if anyone could advise please?

Here is my /etc/network/interfaces that doesn't work:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
auto enp6s0
iface enp6s0 inet dhcp
    dns-nameservers 120.139.14.230 120.139.14.231
    dns-search ad.mydomain.com
auto enp7s0
iface enp7s0 inet dhcp
    dns-nameservers 120.139.14.230 120.139.14.231
    dns-search ad.mydomain.com
auto ens7f0
iface ens7f0 inet dhcp
    dns-nameservers 120.139.14.230 120.139.14.231
    dns-search ad.mydomain.com
auto ens7f1
iface ens7f1 inet dhcp
    dns-nameservers 120.139.14.230 120.139.14.231
    dns-search ad.mydomain.com

and this is when it works:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
#auto enp6s0
#iface enp6s0 inet dhcp
#    dns-nameservers 120.139.14.230 120.139.14.231
#    dns-search ad.mydomain.com
#auto enp7s0
#iface enp7s0 inet dhcp
#    dns-nameservers 120.139.14.230 120.139.14.231
#    dns-search ad.mydomain.com
auto ens7f0
iface ens7f0 inet dhcp
    dns-nameservers 120.139.14.230 120.139.14.231
    dns-search ad.mydomain.com
#auto ens7f1
#iface ens7f1 inet dhcp
#    dns-nameservers 120.139.14.230 120.139.14.231
#    dns-search ad.mydomain.com

So I wonder how to do setup all interfaces to have the same dns-nameservers and dns-search?

Output of ifconfig -a:

enp6s0    Link encap:Ethernet  HWaddr 2c:4d:54:44:a0:25  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Memory:ce400000-ce47ffff 

enp7s0    Link encap:Ethernet  HWaddr 2c:4d:54:44:a0:26  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Memory:ce300000-ce37ffff 

ens7f0    Link encap:Ethernet  HWaddr a0:36:9f:f5:c2:b8  
          inet addr:120.139.195.90  Bcast:120.139.195.255  Mask:255.255.254.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:29651 errors:0 dropped:1 overruns:0 frame:0
          TX packets:7066 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:8988328 (8.9 MB)  TX bytes:1500983 (1.5 MB)

ens7f1    Link encap:Ethernet  HWaddr a0:36:9f:f5:c2:b9  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:44822 errors:0 dropped:0 overruns:0 frame:0
          TX packets:44822 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3514738 (3.5 MB)  TX bytes:3514738 (3.5 MB)

ip link show output:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp6s0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether 2c:4d:54:44:a0:25 brd ff:ff:ff:ff:ff:ff
3: enp7s0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether 2c:4d:54:44:a0:26 brd ff:ff:ff:ff:ff:ff
4: ens7f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether a0:36:9f:f5:c2:b8 brd ff:ff:ff:ff:ff:ff
5: ens7f1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether a0:36:9f:f5:c2:b9 brd ff:ff:ff:ff:ff:ff

Your Answer

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

Browse other questions tagged or ask your own question.