Return to

[Ubuntu] Line order of resolv dot conf?

What is the correct line order for the domain, search and nameserver pieces that make up resolv.conf?

I read through the info here, but couldn’t find a specific answer.

Searching the general internet eludes to “it doesn’t matter”, but it sure seems like “programmatically” there would be a definitive “right way” even if it’s generally not followed to specification?

From what I can tell this is a key-value-pair type deal.
I would guess it doesn’t matter either, because programatically it probably just reads in all the lines and searches for the possible keywords in each line, the rest of the line (before or after) being the value.

The autogenerated file on Fedora looks like this:

<keyword> <value>

Which would also make it easier to sort and search through if for some reason you have a ton of entries.

Like he said, i don’t think it matters, as per above, so long as the directives match up the correct key/value pairs you should be good.

Normal convention is

search yourlocaldomain.tld
nameserver x.x.x.x
nameserver y.y.y.y

but so long as the lines are each individually syntax-correct it should just work whatever order.