Changing resolv.conf on Jetpack 4.6

Hi all, I’m running into an issue with configuring new nameservers on the Xavier NX and I was hoping to get some insight into how to best do this in JP 4.6.

What I essentially want to do is add some extra nameserver IPs to the default /etc/resolv.conf, like Google’s 8.8.8.8. I can do it via a systemd script that at every boot echos these lines in, but seeing how default /etc/resolv.conf file has this banner at the top saying it should not be edited by hand, it’s likely not the right approach.
One thing I’ve tried is to create an /etc/resolvconf/resolv.conf.d/base and a /etc/resolvconf/resolv.conf.d/head with my new servers, but those unfortunately didn’t propagate over to /etc/resolv.conf. Although online lots of people mention the file in /etc being a symlink to /run/systemd/resolve/resolv.conf, that does not seem to be the case on the Jetson.

So my two question are: how does the resolv.conf file get populated with its default contents? (“search nvidia.com”, etc.) And how can I make use of this same process/service to add my own nameservers too?

Thank you!
Andreea

Mostly I can’t answer this. What I can tell you is that unless something has been customized, then it is the router (when using DHCP) which assigns those. The router itself will be passing along servers which the upstream router provides (e.g., the ISP assigns name server to the local modem/router, and this passes on to the local computer). Also, files in “/run” are generated dynamically at run time, e.g., by netplan and/or NetworkManager.

No doubt there are ways to change this, but are you looking to completely replace name servers, or to supplement this? There is a pretty small maximum list size for name servers, and I’m going to guess that it is far easier to replace this list than it is to add something.

If you have your own router, then perhaps one could use admin access and edit the name server list to pass on, and this would “just work” and do what it should for every device on that router (should you want all devices to use that list).

Thanks for the reply!
In my use case the Jetson is mostly offline actually, but occassionally gets Internet access when shared from another device (connected via USB or Ethernet). There’s no DHCP in between, just statically configured addresses.
At the moment I am just appending the line “nameserver 8.8.8.8” on every boot to what’s already in resolv.conf, so in effect I am supplementing the list, but only because it seems that without additional servers the device wouldn’t know how to resolve names anyway. The original Nvidia resolv.conf file looks like this:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
search nvidia.com

Where 127.0.1.1 is also mapped to localhost. I mostly just want to know if there’s a more robust solution to adding nameservers. I think the original file is part of the base Jetpack rootfs, because I can see it in the L4T directory, but what exactly resets its contents over a reboot is a bit opaque to me still.

There are multiple ways to configure this, but I tend to use “nm-connection-editor” (“sudo apt-get install network-manager-gnome”). “sudo nm-connection-editor” will bring up a GUI where you can select and edit the particular interface, specifying static IP address and name server addresses. You could later uncheck the “manual” address and switch back to DHCP, or the reverse.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.