Setting up /etc/network/interfaces

8,463

Your question is a bit unclear, but in case you want to set custom DNS you can do it in few ways.

  1. add dns-nameservers {IP} to your interfaces file.
  2. or add nameserver {IP} to /etc/resolv.conf (this is not permanent solution).
Share:
8,463

Related videos on Youtube

Gary
Author by

Gary

Updated on September 18, 2022

Comments

  • Gary
    Gary over 1 year

    I am setting up a connection to Optimum business with a static ip

    • Ip address 47.x.x.62
    • Default gateway 47.x.x.61
    • subnet mask 255.255.255.252
    • Primary DNS server 167.x.x.138
    • Seconday DNS Server 167.x.x.4

    I am trying to set up eth0 (eno1) to be on the static IP and eth1 (eno2) to be on the network (LAN) eno2 is up and working but eno1 is not.

    I don't seem to be getting to commands to set up to the name server correct any suggestions?

    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).
    
    source /etc/network/interfaces.d/*
    
    # The loopback network interface
    auto lo
    iface lo inet loopback
    
    # The primary network interface
    auto eno1
    #iface eno1 inet dhcp
    iface eno1 inet static
        address 47.x.x.62
        netmask 255.255.255.252
        gateway 47.x.x.61
    
    # The primary network interface
    auto eno2
    #iface eno2 inet dhcp
    iface eno2 inet static
        address 192.168.1.5
        netmask 255.255.255.0
        gateway 192.168.1.1
    
    • Gary
      Gary about 6 years
      this is for ubuntu 16.04
    • Philippe Delteil
      Philippe Delteil about 6 years
      eno2 is supposed to be statis as well? Are you sure the gateway is accepting static ips?
    • AsenM
      AsenM about 6 years
      What exactly is your problem?
    • Philippe Delteil
      Philippe Delteil about 6 years
      What do you mean by 'I don't seem to be getting to commands to set up to the name server correct' ? what name server?
    • Gary
      Gary about 6 years
      on my optimun business account i have to set up IP subnet gateway and primary/secondary dns server to access it
    • Gary
      Gary about 6 years
      the exact problem is I want eno1 directly to the internet and Its not on the net
    • Gary
      Gary about 6 years
      eno1 is set to static because Optimum business requires it eno2 is also set to static because i want it on the same LAN ip which is shut of from the WWW
  • Gary
    Gary about 6 years
    when i put dns-nameservers in on ifconfig I get host name lookup failure