/etc/networks File

Home » CentOS » /etc/networks File
CentOS 4 Comments

I am having some network connectivity issues that manifest itself through ping, wget, dnf, etc. The symptoms are intermittent ability to ping, was wget, or connect to repositories.

Where this inquiry is going is: If your internal network is using 192.168.1 or 10..50.10, what should be in /etc/networks.

My current file contains:

default 0.0.0.0
loopback 127.0.0.0
link-local 169.254.0.0

And I’m pretty sure this is the default OS installed contents.

I don’t think this is related to my connectivity issue, just curious about what this file does.

My old server (which is working just fine) has the same content in its /etc/networks file so not configuring this does not seem to matter one way or the other.

If one were using 192.168.1.x network , assume ‘default’ should be 192.168.1.0. ‘Link-local’
should match???

Thanks,

Jay

4 thoughts on - /etc/networks File

  • These are CentOS systems, aren’t they? CentOS doesn’t configure networking with /etc/networks. The files they use are in /etc/sysconfig/network-scripts/ifcfg-*.


    Jonathan Billings

  • This is an archaic file which is equivalent to /etc/hosts and can be used by various network tools instead of DNS. https://linux-audit.com/the-purpose-of-etc-networks/

    Other than getent, this file seems to be little use in a default EL7/EL8
    system as route and netstat were ‘deprecated’ and have to be installed outside of default installs.

  • IIRC, the names in /etc/networks would be used in places like ip.wrappers and NFS exports. The earliest Solaris networks I worked with made pretty extensive use of that archaic kinda stuff.