How shall I understand the format of `/etc/resolv.conf`?












1















How shall I understand the format of /etc/resolv.conf?



$ cat /etc/resolv.conf
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "systemd-resolve --status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 127.0.0.53
search fios-router.home


Manpage of /etc/resolve.conf says




The different configuration options are:



   nameserver Name server IP address

Internet address of a name server that the resolver should
query...



So does nameserver 127.0.0.53 mean that my local machine is running a DNS server whose IP address is 127.0.0.53? How can I find out its process?




   domain Local domain name.

Most queries for names within this domain can use short names
relative to the local domain. If set to '.', the root domain
is considered. If no domain entry is present, the domain is
determined from the local hostname returned by gethostname(2);
the domain part is taken to be everything after the first '.'.
Finally, if the hostname does not contain a domain part, the
root domain is assumed.



What does this part mean? The above just mentions what values that can be set to something, and does not explain what this part in /etc/resolv.conf means. Why does my /etc/resolv.conf not have this part?




   search Search list for host-name lookup.

The search list is normally determined from the local domain
name; by default, it contains only the local domain name.



What does this part mean? What does search fios-router.home in my /etc/resolv.conf mean?



Thanks.










share|improve this question

























  • You can run netstat -up as root to see if and who is listening on port 53 of :: or 0.0.0.0 or 127.0.0.53.

    – eckes
    Feb 11 at 21:22











  • freedesktop.org/software/systemd/man/… you might be in a systemd-resolved manging mode

    – 炸鱼薯条德里克
    Feb 12 at 0:33






  • 1





    Just note that the netmask for localhost is 255.0.0.0, a /8. So 127.0.0.53 is also localhost.

    – Lenne
    Feb 12 at 0:49








  • 1





    @eckes netstat -up shows nothing is listening

    – Tim
    Feb 12 at 3:08











  • @Tim then there is most likely nothing listening (however as other answers mentioned this specific ip is documented as a marker for an internal mechanism which bypasses DNS)

    – eckes
    Feb 13 at 11:32
















1















How shall I understand the format of /etc/resolv.conf?



$ cat /etc/resolv.conf
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "systemd-resolve --status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 127.0.0.53
search fios-router.home


Manpage of /etc/resolve.conf says




The different configuration options are:



   nameserver Name server IP address

Internet address of a name server that the resolver should
query...



So does nameserver 127.0.0.53 mean that my local machine is running a DNS server whose IP address is 127.0.0.53? How can I find out its process?




   domain Local domain name.

Most queries for names within this domain can use short names
relative to the local domain. If set to '.', the root domain
is considered. If no domain entry is present, the domain is
determined from the local hostname returned by gethostname(2);
the domain part is taken to be everything after the first '.'.
Finally, if the hostname does not contain a domain part, the
root domain is assumed.



What does this part mean? The above just mentions what values that can be set to something, and does not explain what this part in /etc/resolv.conf means. Why does my /etc/resolv.conf not have this part?




   search Search list for host-name lookup.

The search list is normally determined from the local domain
name; by default, it contains only the local domain name.



What does this part mean? What does search fios-router.home in my /etc/resolv.conf mean?



Thanks.










share|improve this question

























  • You can run netstat -up as root to see if and who is listening on port 53 of :: or 0.0.0.0 or 127.0.0.53.

    – eckes
    Feb 11 at 21:22











  • freedesktop.org/software/systemd/man/… you might be in a systemd-resolved manging mode

    – 炸鱼薯条德里克
    Feb 12 at 0:33






  • 1





    Just note that the netmask for localhost is 255.0.0.0, a /8. So 127.0.0.53 is also localhost.

    – Lenne
    Feb 12 at 0:49








  • 1





    @eckes netstat -up shows nothing is listening

    – Tim
    Feb 12 at 3:08











  • @Tim then there is most likely nothing listening (however as other answers mentioned this specific ip is documented as a marker for an internal mechanism which bypasses DNS)

    – eckes
    Feb 13 at 11:32














1












1








1


0






How shall I understand the format of /etc/resolv.conf?



$ cat /etc/resolv.conf
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "systemd-resolve --status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 127.0.0.53
search fios-router.home


Manpage of /etc/resolve.conf says




The different configuration options are:



   nameserver Name server IP address

Internet address of a name server that the resolver should
query...



So does nameserver 127.0.0.53 mean that my local machine is running a DNS server whose IP address is 127.0.0.53? How can I find out its process?




   domain Local domain name.

Most queries for names within this domain can use short names
relative to the local domain. If set to '.', the root domain
is considered. If no domain entry is present, the domain is
determined from the local hostname returned by gethostname(2);
the domain part is taken to be everything after the first '.'.
Finally, if the hostname does not contain a domain part, the
root domain is assumed.



What does this part mean? The above just mentions what values that can be set to something, and does not explain what this part in /etc/resolv.conf means. Why does my /etc/resolv.conf not have this part?




   search Search list for host-name lookup.

The search list is normally determined from the local domain
name; by default, it contains only the local domain name.



What does this part mean? What does search fios-router.home in my /etc/resolv.conf mean?



Thanks.










share|improve this question
















How shall I understand the format of /etc/resolv.conf?



$ cat /etc/resolv.conf
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "systemd-resolve --status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 127.0.0.53
search fios-router.home


Manpage of /etc/resolve.conf says




The different configuration options are:



   nameserver Name server IP address

Internet address of a name server that the resolver should
query...



So does nameserver 127.0.0.53 mean that my local machine is running a DNS server whose IP address is 127.0.0.53? How can I find out its process?




   domain Local domain name.

Most queries for names within this domain can use short names
relative to the local domain. If set to '.', the root domain
is considered. If no domain entry is present, the domain is
determined from the local hostname returned by gethostname(2);
the domain part is taken to be everything after the first '.'.
Finally, if the hostname does not contain a domain part, the
root domain is assumed.



What does this part mean? The above just mentions what values that can be set to something, and does not explain what this part in /etc/resolv.conf means. Why does my /etc/resolv.conf not have this part?




   search Search list for host-name lookup.

The search list is normally determined from the local domain
name; by default, it contains only the local domain name.



What does this part mean? What does search fios-router.home in my /etc/resolv.conf mean?



Thanks.







dns resolv.conf






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 11 at 18:05







Tim

















asked Feb 11 at 17:42









TimTim

27.1k78262472




27.1k78262472













  • You can run netstat -up as root to see if and who is listening on port 53 of :: or 0.0.0.0 or 127.0.0.53.

    – eckes
    Feb 11 at 21:22











  • freedesktop.org/software/systemd/man/… you might be in a systemd-resolved manging mode

    – 炸鱼薯条德里克
    Feb 12 at 0:33






  • 1





    Just note that the netmask for localhost is 255.0.0.0, a /8. So 127.0.0.53 is also localhost.

    – Lenne
    Feb 12 at 0:49








  • 1





    @eckes netstat -up shows nothing is listening

    – Tim
    Feb 12 at 3:08











  • @Tim then there is most likely nothing listening (however as other answers mentioned this specific ip is documented as a marker for an internal mechanism which bypasses DNS)

    – eckes
    Feb 13 at 11:32



















  • You can run netstat -up as root to see if and who is listening on port 53 of :: or 0.0.0.0 or 127.0.0.53.

    – eckes
    Feb 11 at 21:22











  • freedesktop.org/software/systemd/man/… you might be in a systemd-resolved manging mode

    – 炸鱼薯条德里克
    Feb 12 at 0:33






  • 1





    Just note that the netmask for localhost is 255.0.0.0, a /8. So 127.0.0.53 is also localhost.

    – Lenne
    Feb 12 at 0:49








  • 1





    @eckes netstat -up shows nothing is listening

    – Tim
    Feb 12 at 3:08











  • @Tim then there is most likely nothing listening (however as other answers mentioned this specific ip is documented as a marker for an internal mechanism which bypasses DNS)

    – eckes
    Feb 13 at 11:32

















You can run netstat -up as root to see if and who is listening on port 53 of :: or 0.0.0.0 or 127.0.0.53.

– eckes
Feb 11 at 21:22





You can run netstat -up as root to see if and who is listening on port 53 of :: or 0.0.0.0 or 127.0.0.53.

– eckes
Feb 11 at 21:22













freedesktop.org/software/systemd/man/… you might be in a systemd-resolved manging mode

– 炸鱼薯条德里克
Feb 12 at 0:33





freedesktop.org/software/systemd/man/… you might be in a systemd-resolved manging mode

– 炸鱼薯条德里克
Feb 12 at 0:33




1




1





Just note that the netmask for localhost is 255.0.0.0, a /8. So 127.0.0.53 is also localhost.

– Lenne
Feb 12 at 0:49







Just note that the netmask for localhost is 255.0.0.0, a /8. So 127.0.0.53 is also localhost.

– Lenne
Feb 12 at 0:49






1




1





@eckes netstat -up shows nothing is listening

– Tim
Feb 12 at 3:08





@eckes netstat -up shows nothing is listening

– Tim
Feb 12 at 3:08













@Tim then there is most likely nothing listening (however as other answers mentioned this specific ip is documented as a marker for an internal mechanism which bypasses DNS)

– eckes
Feb 13 at 11:32





@Tim then there is most likely nothing listening (however as other answers mentioned this specific ip is documented as a marker for an internal mechanism which bypasses DNS)

– eckes
Feb 13 at 11:32










4 Answers
4






active

oldest

votes


















3














Yes, the first part indicates that your system is expecting a nameserver to be listening on localhost, in this case, specifically 127.0.0.53.



The second part is a search path that is appended to all searches not ending in a period (.). If you run, for instance, ssh blah, DNS will first try to look up blah, then try looking up blah.fios-router.home.






share|improve this answer


























  • Thanks. I never know the local machine is running a DNS server. Can you tell me how to find out its process?

    – Tim
    Feb 11 at 18:01











  • Try pgrep systemd-resolved or systemctl status systemd-resolved.

    – telcoM
    Feb 11 at 18:39











  • @telcoM pgrep systemd-resolved returns nothing. Does nameserver 127.0.0.53 really mean the my local machine is running a DNS server?

    – Tim
    Feb 12 at 2:43













  • It means your system is expecting to have something in that address that can receive and resolve DNS requests just like a (resolver-type) DNS server. But expecting something is not the same as actually having it. And when I just tested, it looks like the way systemd starts systemd-resolved can fool pgrep. Try just pgrep resolv.

    – telcoM
    Feb 12 at 7:40



















3














/etc/resolve.conf is the main configuration file for the DNS client, so its presence does not imply that you are running a DNS server.



Its primary purpose is to list the IP addresses of DNS servers, in your case:




nameserver 127.0.0.53





  • Entries of type nameserver tell the host, which DNS server to use.

  • An entry of type domain (if present) tells the system which domain it is in. This allows to be addressed by its host name. (Addition in response to a comment: The hostname is the computer's name in the network. On many systems, you can see the hostname in the command prompt; if not, you can find it by using the command hostname.)

  • An entry of type search (if present) would allow computers from different domains to address each other by their respective host names.


The file is nowadays usually generated by NeteworkManager (for example, on my system, the file starts with the comment "Generated by NetworkManager") or by systemd-resolved.



systemd-resolved




is a system service that provides network name resolution to local applications. It implements a caching and validating DNS/DNSSEC stub resolver, as well as an LLMNR and MulticastDNS resolver and responder.




Also according to systemd-resolved's manpage, the address 127.0.0.53 is a "local DNS stub listener". On related Stack Exchange sites, there have been questions about how to change this, since the file is /etc/resolv.conf is automatically generated. See for example





  • Wrong nameserver set by resolvconf and NetworkManager (Ubuntu SE).


  • DNS set to systemd's 127.0.0.53 - how to change permanently? (Ubuntu SE).






share|improve this answer





















  • 1





    Thanks. (1) "Entries of type nameserver tell the host, which DNS server to use." 127.0.0.53 is an IP of local machine. How is that not contradictory to "its presence does not imply that you are running a DNS server"? (2) "An entry of type domain (if present) tells the system which domain it is in. This allows to be addressed by its host name." What is the difference and relation between a domain (name) and a host name?

    – Tim
    Feb 11 at 18:11













  • 1) it is only visible to your local system, not to any other systems; not even within your home network. So it does not serve any others. 2) A hostname might be short (host1) or fully-qualified (host1.fios-router.home). In this example, the domain of host1.fios-router.home would be fios-router.home.

    – telcoM
    Feb 11 at 18:38











  • So ls -al /etc/resolv.conf and cat /etc/resolv.conf will inform you which program/service is controlling resolv.conf. If you've messed about with your system then you might have a couple of programs competing for control - I had this before with dnsmasq, bind, and systemd-resolved. In addition @Tim, to what telcoM says about your questions: the DNS server and resolver ("stub resolver") can be different, you can pass DNS requests to 127.0.0.53 which pass them to your router for actual DNS (eg it could handle local hosts but pass requests for remote hosts on for full DNS).

    – pbhj
    Feb 11 at 20:36






  • 1





    @pbhj "you can pass DNS requests to 127.0.0.53 which pass them to your router for actual DNS." 127.0.0.53 refers to the local machine itself, so why does it pass DNS request to your router ?

    – Tim
    Feb 12 at 2:41



















2














The search fios-router.home part is the last resolvable domain, i.e. your router (iirc Verizon).



127.0.0.53 is the IP address of the nameserver, so your assumption is correct.






share|improve this answer


























  • Thanks. (1) What is "a resolvable domain" and what is "the last resolvable domain"? (2) Do you mean my local machine is running a DNS server? Which process is the DNS server?

    – Tim
    Feb 11 at 17:54





















1














resolv.conf is part of the standard way to resolve a host name to an IP address. It is part of the resolver library.



There are different ways to resolve your host name:




  • files (specifically: /etc/hosts)

  • dns

  • NIS, NIS+ or yp


The sequence in which they are used is in /etc/nsswitch.conf. This normally says



hosts:      files dns


which means that the resolver library first looks in /etc/hosts and, if it cannot find it there, will use DNS.



Now DNS will query a DNS server. Which one is determined by /etc/resolv.conf. In addition, there are a number of additional parameters that you can use to help the DNS reolution, of which search (Try this domain first for the host) is probably the most used.






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f499993%2fhow-shall-i-understand-the-format-of-etc-resolv-conf%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    4 Answers
    4






    active

    oldest

    votes








    4 Answers
    4






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    Yes, the first part indicates that your system is expecting a nameserver to be listening on localhost, in this case, specifically 127.0.0.53.



    The second part is a search path that is appended to all searches not ending in a period (.). If you run, for instance, ssh blah, DNS will first try to look up blah, then try looking up blah.fios-router.home.






    share|improve this answer


























    • Thanks. I never know the local machine is running a DNS server. Can you tell me how to find out its process?

      – Tim
      Feb 11 at 18:01











    • Try pgrep systemd-resolved or systemctl status systemd-resolved.

      – telcoM
      Feb 11 at 18:39











    • @telcoM pgrep systemd-resolved returns nothing. Does nameserver 127.0.0.53 really mean the my local machine is running a DNS server?

      – Tim
      Feb 12 at 2:43













    • It means your system is expecting to have something in that address that can receive and resolve DNS requests just like a (resolver-type) DNS server. But expecting something is not the same as actually having it. And when I just tested, it looks like the way systemd starts systemd-resolved can fool pgrep. Try just pgrep resolv.

      – telcoM
      Feb 12 at 7:40
















    3














    Yes, the first part indicates that your system is expecting a nameserver to be listening on localhost, in this case, specifically 127.0.0.53.



    The second part is a search path that is appended to all searches not ending in a period (.). If you run, for instance, ssh blah, DNS will first try to look up blah, then try looking up blah.fios-router.home.






    share|improve this answer


























    • Thanks. I never know the local machine is running a DNS server. Can you tell me how to find out its process?

      – Tim
      Feb 11 at 18:01











    • Try pgrep systemd-resolved or systemctl status systemd-resolved.

      – telcoM
      Feb 11 at 18:39











    • @telcoM pgrep systemd-resolved returns nothing. Does nameserver 127.0.0.53 really mean the my local machine is running a DNS server?

      – Tim
      Feb 12 at 2:43













    • It means your system is expecting to have something in that address that can receive and resolve DNS requests just like a (resolver-type) DNS server. But expecting something is not the same as actually having it. And when I just tested, it looks like the way systemd starts systemd-resolved can fool pgrep. Try just pgrep resolv.

      – telcoM
      Feb 12 at 7:40














    3












    3








    3







    Yes, the first part indicates that your system is expecting a nameserver to be listening on localhost, in this case, specifically 127.0.0.53.



    The second part is a search path that is appended to all searches not ending in a period (.). If you run, for instance, ssh blah, DNS will first try to look up blah, then try looking up blah.fios-router.home.






    share|improve this answer















    Yes, the first part indicates that your system is expecting a nameserver to be listening on localhost, in this case, specifically 127.0.0.53.



    The second part is a search path that is appended to all searches not ending in a period (.). If you run, for instance, ssh blah, DNS will first try to look up blah, then try looking up blah.fios-router.home.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Feb 11 at 18:23









    Jeff Schaller

    41.5k1056132




    41.5k1056132










    answered Feb 11 at 17:54









    Doug O'NealDoug O'Neal

    2,9401818




    2,9401818













    • Thanks. I never know the local machine is running a DNS server. Can you tell me how to find out its process?

      – Tim
      Feb 11 at 18:01











    • Try pgrep systemd-resolved or systemctl status systemd-resolved.

      – telcoM
      Feb 11 at 18:39











    • @telcoM pgrep systemd-resolved returns nothing. Does nameserver 127.0.0.53 really mean the my local machine is running a DNS server?

      – Tim
      Feb 12 at 2:43













    • It means your system is expecting to have something in that address that can receive and resolve DNS requests just like a (resolver-type) DNS server. But expecting something is not the same as actually having it. And when I just tested, it looks like the way systemd starts systemd-resolved can fool pgrep. Try just pgrep resolv.

      – telcoM
      Feb 12 at 7:40



















    • Thanks. I never know the local machine is running a DNS server. Can you tell me how to find out its process?

      – Tim
      Feb 11 at 18:01











    • Try pgrep systemd-resolved or systemctl status systemd-resolved.

      – telcoM
      Feb 11 at 18:39











    • @telcoM pgrep systemd-resolved returns nothing. Does nameserver 127.0.0.53 really mean the my local machine is running a DNS server?

      – Tim
      Feb 12 at 2:43













    • It means your system is expecting to have something in that address that can receive and resolve DNS requests just like a (resolver-type) DNS server. But expecting something is not the same as actually having it. And when I just tested, it looks like the way systemd starts systemd-resolved can fool pgrep. Try just pgrep resolv.

      – telcoM
      Feb 12 at 7:40

















    Thanks. I never know the local machine is running a DNS server. Can you tell me how to find out its process?

    – Tim
    Feb 11 at 18:01





    Thanks. I never know the local machine is running a DNS server. Can you tell me how to find out its process?

    – Tim
    Feb 11 at 18:01













    Try pgrep systemd-resolved or systemctl status systemd-resolved.

    – telcoM
    Feb 11 at 18:39





    Try pgrep systemd-resolved or systemctl status systemd-resolved.

    – telcoM
    Feb 11 at 18:39













    @telcoM pgrep systemd-resolved returns nothing. Does nameserver 127.0.0.53 really mean the my local machine is running a DNS server?

    – Tim
    Feb 12 at 2:43







    @telcoM pgrep systemd-resolved returns nothing. Does nameserver 127.0.0.53 really mean the my local machine is running a DNS server?

    – Tim
    Feb 12 at 2:43















    It means your system is expecting to have something in that address that can receive and resolve DNS requests just like a (resolver-type) DNS server. But expecting something is not the same as actually having it. And when I just tested, it looks like the way systemd starts systemd-resolved can fool pgrep. Try just pgrep resolv.

    – telcoM
    Feb 12 at 7:40





    It means your system is expecting to have something in that address that can receive and resolve DNS requests just like a (resolver-type) DNS server. But expecting something is not the same as actually having it. And when I just tested, it looks like the way systemd starts systemd-resolved can fool pgrep. Try just pgrep resolv.

    – telcoM
    Feb 12 at 7:40













    3














    /etc/resolve.conf is the main configuration file for the DNS client, so its presence does not imply that you are running a DNS server.



    Its primary purpose is to list the IP addresses of DNS servers, in your case:




    nameserver 127.0.0.53





    • Entries of type nameserver tell the host, which DNS server to use.

    • An entry of type domain (if present) tells the system which domain it is in. This allows to be addressed by its host name. (Addition in response to a comment: The hostname is the computer's name in the network. On many systems, you can see the hostname in the command prompt; if not, you can find it by using the command hostname.)

    • An entry of type search (if present) would allow computers from different domains to address each other by their respective host names.


    The file is nowadays usually generated by NeteworkManager (for example, on my system, the file starts with the comment "Generated by NetworkManager") or by systemd-resolved.



    systemd-resolved




    is a system service that provides network name resolution to local applications. It implements a caching and validating DNS/DNSSEC stub resolver, as well as an LLMNR and MulticastDNS resolver and responder.




    Also according to systemd-resolved's manpage, the address 127.0.0.53 is a "local DNS stub listener". On related Stack Exchange sites, there have been questions about how to change this, since the file is /etc/resolv.conf is automatically generated. See for example





    • Wrong nameserver set by resolvconf and NetworkManager (Ubuntu SE).


    • DNS set to systemd's 127.0.0.53 - how to change permanently? (Ubuntu SE).






    share|improve this answer





















    • 1





      Thanks. (1) "Entries of type nameserver tell the host, which DNS server to use." 127.0.0.53 is an IP of local machine. How is that not contradictory to "its presence does not imply that you are running a DNS server"? (2) "An entry of type domain (if present) tells the system which domain it is in. This allows to be addressed by its host name." What is the difference and relation between a domain (name) and a host name?

      – Tim
      Feb 11 at 18:11













    • 1) it is only visible to your local system, not to any other systems; not even within your home network. So it does not serve any others. 2) A hostname might be short (host1) or fully-qualified (host1.fios-router.home). In this example, the domain of host1.fios-router.home would be fios-router.home.

      – telcoM
      Feb 11 at 18:38











    • So ls -al /etc/resolv.conf and cat /etc/resolv.conf will inform you which program/service is controlling resolv.conf. If you've messed about with your system then you might have a couple of programs competing for control - I had this before with dnsmasq, bind, and systemd-resolved. In addition @Tim, to what telcoM says about your questions: the DNS server and resolver ("stub resolver") can be different, you can pass DNS requests to 127.0.0.53 which pass them to your router for actual DNS (eg it could handle local hosts but pass requests for remote hosts on for full DNS).

      – pbhj
      Feb 11 at 20:36






    • 1





      @pbhj "you can pass DNS requests to 127.0.0.53 which pass them to your router for actual DNS." 127.0.0.53 refers to the local machine itself, so why does it pass DNS request to your router ?

      – Tim
      Feb 12 at 2:41
















    3














    /etc/resolve.conf is the main configuration file for the DNS client, so its presence does not imply that you are running a DNS server.



    Its primary purpose is to list the IP addresses of DNS servers, in your case:




    nameserver 127.0.0.53





    • Entries of type nameserver tell the host, which DNS server to use.

    • An entry of type domain (if present) tells the system which domain it is in. This allows to be addressed by its host name. (Addition in response to a comment: The hostname is the computer's name in the network. On many systems, you can see the hostname in the command prompt; if not, you can find it by using the command hostname.)

    • An entry of type search (if present) would allow computers from different domains to address each other by their respective host names.


    The file is nowadays usually generated by NeteworkManager (for example, on my system, the file starts with the comment "Generated by NetworkManager") or by systemd-resolved.



    systemd-resolved




    is a system service that provides network name resolution to local applications. It implements a caching and validating DNS/DNSSEC stub resolver, as well as an LLMNR and MulticastDNS resolver and responder.




    Also according to systemd-resolved's manpage, the address 127.0.0.53 is a "local DNS stub listener". On related Stack Exchange sites, there have been questions about how to change this, since the file is /etc/resolv.conf is automatically generated. See for example





    • Wrong nameserver set by resolvconf and NetworkManager (Ubuntu SE).


    • DNS set to systemd's 127.0.0.53 - how to change permanently? (Ubuntu SE).






    share|improve this answer





















    • 1





      Thanks. (1) "Entries of type nameserver tell the host, which DNS server to use." 127.0.0.53 is an IP of local machine. How is that not contradictory to "its presence does not imply that you are running a DNS server"? (2) "An entry of type domain (if present) tells the system which domain it is in. This allows to be addressed by its host name." What is the difference and relation between a domain (name) and a host name?

      – Tim
      Feb 11 at 18:11













    • 1) it is only visible to your local system, not to any other systems; not even within your home network. So it does not serve any others. 2) A hostname might be short (host1) or fully-qualified (host1.fios-router.home). In this example, the domain of host1.fios-router.home would be fios-router.home.

      – telcoM
      Feb 11 at 18:38











    • So ls -al /etc/resolv.conf and cat /etc/resolv.conf will inform you which program/service is controlling resolv.conf. If you've messed about with your system then you might have a couple of programs competing for control - I had this before with dnsmasq, bind, and systemd-resolved. In addition @Tim, to what telcoM says about your questions: the DNS server and resolver ("stub resolver") can be different, you can pass DNS requests to 127.0.0.53 which pass them to your router for actual DNS (eg it could handle local hosts but pass requests for remote hosts on for full DNS).

      – pbhj
      Feb 11 at 20:36






    • 1





      @pbhj "you can pass DNS requests to 127.0.0.53 which pass them to your router for actual DNS." 127.0.0.53 refers to the local machine itself, so why does it pass DNS request to your router ?

      – Tim
      Feb 12 at 2:41














    3












    3








    3







    /etc/resolve.conf is the main configuration file for the DNS client, so its presence does not imply that you are running a DNS server.



    Its primary purpose is to list the IP addresses of DNS servers, in your case:




    nameserver 127.0.0.53





    • Entries of type nameserver tell the host, which DNS server to use.

    • An entry of type domain (if present) tells the system which domain it is in. This allows to be addressed by its host name. (Addition in response to a comment: The hostname is the computer's name in the network. On many systems, you can see the hostname in the command prompt; if not, you can find it by using the command hostname.)

    • An entry of type search (if present) would allow computers from different domains to address each other by their respective host names.


    The file is nowadays usually generated by NeteworkManager (for example, on my system, the file starts with the comment "Generated by NetworkManager") or by systemd-resolved.



    systemd-resolved




    is a system service that provides network name resolution to local applications. It implements a caching and validating DNS/DNSSEC stub resolver, as well as an LLMNR and MulticastDNS resolver and responder.




    Also according to systemd-resolved's manpage, the address 127.0.0.53 is a "local DNS stub listener". On related Stack Exchange sites, there have been questions about how to change this, since the file is /etc/resolv.conf is automatically generated. See for example





    • Wrong nameserver set by resolvconf and NetworkManager (Ubuntu SE).


    • DNS set to systemd's 127.0.0.53 - how to change permanently? (Ubuntu SE).






    share|improve this answer















    /etc/resolve.conf is the main configuration file for the DNS client, so its presence does not imply that you are running a DNS server.



    Its primary purpose is to list the IP addresses of DNS servers, in your case:




    nameserver 127.0.0.53





    • Entries of type nameserver tell the host, which DNS server to use.

    • An entry of type domain (if present) tells the system which domain it is in. This allows to be addressed by its host name. (Addition in response to a comment: The hostname is the computer's name in the network. On many systems, you can see the hostname in the command prompt; if not, you can find it by using the command hostname.)

    • An entry of type search (if present) would allow computers from different domains to address each other by their respective host names.


    The file is nowadays usually generated by NeteworkManager (for example, on my system, the file starts with the comment "Generated by NetworkManager") or by systemd-resolved.



    systemd-resolved




    is a system service that provides network name resolution to local applications. It implements a caching and validating DNS/DNSSEC stub resolver, as well as an LLMNR and MulticastDNS resolver and responder.




    Also according to systemd-resolved's manpage, the address 127.0.0.53 is a "local DNS stub listener". On related Stack Exchange sites, there have been questions about how to change this, since the file is /etc/resolv.conf is automatically generated. See for example





    • Wrong nameserver set by resolvconf and NetworkManager (Ubuntu SE).


    • DNS set to systemd's 127.0.0.53 - how to change permanently? (Ubuntu SE).







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Feb 11 at 19:43

























    answered Feb 11 at 17:59









    Christophe StrobbeChristophe Strobbe

    2171213




    2171213








    • 1





      Thanks. (1) "Entries of type nameserver tell the host, which DNS server to use." 127.0.0.53 is an IP of local machine. How is that not contradictory to "its presence does not imply that you are running a DNS server"? (2) "An entry of type domain (if present) tells the system which domain it is in. This allows to be addressed by its host name." What is the difference and relation between a domain (name) and a host name?

      – Tim
      Feb 11 at 18:11













    • 1) it is only visible to your local system, not to any other systems; not even within your home network. So it does not serve any others. 2) A hostname might be short (host1) or fully-qualified (host1.fios-router.home). In this example, the domain of host1.fios-router.home would be fios-router.home.

      – telcoM
      Feb 11 at 18:38











    • So ls -al /etc/resolv.conf and cat /etc/resolv.conf will inform you which program/service is controlling resolv.conf. If you've messed about with your system then you might have a couple of programs competing for control - I had this before with dnsmasq, bind, and systemd-resolved. In addition @Tim, to what telcoM says about your questions: the DNS server and resolver ("stub resolver") can be different, you can pass DNS requests to 127.0.0.53 which pass them to your router for actual DNS (eg it could handle local hosts but pass requests for remote hosts on for full DNS).

      – pbhj
      Feb 11 at 20:36






    • 1





      @pbhj "you can pass DNS requests to 127.0.0.53 which pass them to your router for actual DNS." 127.0.0.53 refers to the local machine itself, so why does it pass DNS request to your router ?

      – Tim
      Feb 12 at 2:41














    • 1





      Thanks. (1) "Entries of type nameserver tell the host, which DNS server to use." 127.0.0.53 is an IP of local machine. How is that not contradictory to "its presence does not imply that you are running a DNS server"? (2) "An entry of type domain (if present) tells the system which domain it is in. This allows to be addressed by its host name." What is the difference and relation between a domain (name) and a host name?

      – Tim
      Feb 11 at 18:11













    • 1) it is only visible to your local system, not to any other systems; not even within your home network. So it does not serve any others. 2) A hostname might be short (host1) or fully-qualified (host1.fios-router.home). In this example, the domain of host1.fios-router.home would be fios-router.home.

      – telcoM
      Feb 11 at 18:38











    • So ls -al /etc/resolv.conf and cat /etc/resolv.conf will inform you which program/service is controlling resolv.conf. If you've messed about with your system then you might have a couple of programs competing for control - I had this before with dnsmasq, bind, and systemd-resolved. In addition @Tim, to what telcoM says about your questions: the DNS server and resolver ("stub resolver") can be different, you can pass DNS requests to 127.0.0.53 which pass them to your router for actual DNS (eg it could handle local hosts but pass requests for remote hosts on for full DNS).

      – pbhj
      Feb 11 at 20:36






    • 1





      @pbhj "you can pass DNS requests to 127.0.0.53 which pass them to your router for actual DNS." 127.0.0.53 refers to the local machine itself, so why does it pass DNS request to your router ?

      – Tim
      Feb 12 at 2:41








    1




    1





    Thanks. (1) "Entries of type nameserver tell the host, which DNS server to use." 127.0.0.53 is an IP of local machine. How is that not contradictory to "its presence does not imply that you are running a DNS server"? (2) "An entry of type domain (if present) tells the system which domain it is in. This allows to be addressed by its host name." What is the difference and relation between a domain (name) and a host name?

    – Tim
    Feb 11 at 18:11







    Thanks. (1) "Entries of type nameserver tell the host, which DNS server to use." 127.0.0.53 is an IP of local machine. How is that not contradictory to "its presence does not imply that you are running a DNS server"? (2) "An entry of type domain (if present) tells the system which domain it is in. This allows to be addressed by its host name." What is the difference and relation between a domain (name) and a host name?

    – Tim
    Feb 11 at 18:11















    1) it is only visible to your local system, not to any other systems; not even within your home network. So it does not serve any others. 2) A hostname might be short (host1) or fully-qualified (host1.fios-router.home). In this example, the domain of host1.fios-router.home would be fios-router.home.

    – telcoM
    Feb 11 at 18:38





    1) it is only visible to your local system, not to any other systems; not even within your home network. So it does not serve any others. 2) A hostname might be short (host1) or fully-qualified (host1.fios-router.home). In this example, the domain of host1.fios-router.home would be fios-router.home.

    – telcoM
    Feb 11 at 18:38













    So ls -al /etc/resolv.conf and cat /etc/resolv.conf will inform you which program/service is controlling resolv.conf. If you've messed about with your system then you might have a couple of programs competing for control - I had this before with dnsmasq, bind, and systemd-resolved. In addition @Tim, to what telcoM says about your questions: the DNS server and resolver ("stub resolver") can be different, you can pass DNS requests to 127.0.0.53 which pass them to your router for actual DNS (eg it could handle local hosts but pass requests for remote hosts on for full DNS).

    – pbhj
    Feb 11 at 20:36





    So ls -al /etc/resolv.conf and cat /etc/resolv.conf will inform you which program/service is controlling resolv.conf. If you've messed about with your system then you might have a couple of programs competing for control - I had this before with dnsmasq, bind, and systemd-resolved. In addition @Tim, to what telcoM says about your questions: the DNS server and resolver ("stub resolver") can be different, you can pass DNS requests to 127.0.0.53 which pass them to your router for actual DNS (eg it could handle local hosts but pass requests for remote hosts on for full DNS).

    – pbhj
    Feb 11 at 20:36




    1




    1





    @pbhj "you can pass DNS requests to 127.0.0.53 which pass them to your router for actual DNS." 127.0.0.53 refers to the local machine itself, so why does it pass DNS request to your router ?

    – Tim
    Feb 12 at 2:41





    @pbhj "you can pass DNS requests to 127.0.0.53 which pass them to your router for actual DNS." 127.0.0.53 refers to the local machine itself, so why does it pass DNS request to your router ?

    – Tim
    Feb 12 at 2:41











    2














    The search fios-router.home part is the last resolvable domain, i.e. your router (iirc Verizon).



    127.0.0.53 is the IP address of the nameserver, so your assumption is correct.






    share|improve this answer


























    • Thanks. (1) What is "a resolvable domain" and what is "the last resolvable domain"? (2) Do you mean my local machine is running a DNS server? Which process is the DNS server?

      – Tim
      Feb 11 at 17:54


















    2














    The search fios-router.home part is the last resolvable domain, i.e. your router (iirc Verizon).



    127.0.0.53 is the IP address of the nameserver, so your assumption is correct.






    share|improve this answer


























    • Thanks. (1) What is "a resolvable domain" and what is "the last resolvable domain"? (2) Do you mean my local machine is running a DNS server? Which process is the DNS server?

      – Tim
      Feb 11 at 17:54
















    2












    2








    2







    The search fios-router.home part is the last resolvable domain, i.e. your router (iirc Verizon).



    127.0.0.53 is the IP address of the nameserver, so your assumption is correct.






    share|improve this answer















    The search fios-router.home part is the last resolvable domain, i.e. your router (iirc Verizon).



    127.0.0.53 is the IP address of the nameserver, so your assumption is correct.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Feb 11 at 17:55

























    answered Feb 11 at 17:52









    Radu ChiroviciRadu Chirovici

    215




    215













    • Thanks. (1) What is "a resolvable domain" and what is "the last resolvable domain"? (2) Do you mean my local machine is running a DNS server? Which process is the DNS server?

      – Tim
      Feb 11 at 17:54





















    • Thanks. (1) What is "a resolvable domain" and what is "the last resolvable domain"? (2) Do you mean my local machine is running a DNS server? Which process is the DNS server?

      – Tim
      Feb 11 at 17:54



















    Thanks. (1) What is "a resolvable domain" and what is "the last resolvable domain"? (2) Do you mean my local machine is running a DNS server? Which process is the DNS server?

    – Tim
    Feb 11 at 17:54







    Thanks. (1) What is "a resolvable domain" and what is "the last resolvable domain"? (2) Do you mean my local machine is running a DNS server? Which process is the DNS server?

    – Tim
    Feb 11 at 17:54













    1














    resolv.conf is part of the standard way to resolve a host name to an IP address. It is part of the resolver library.



    There are different ways to resolve your host name:




    • files (specifically: /etc/hosts)

    • dns

    • NIS, NIS+ or yp


    The sequence in which they are used is in /etc/nsswitch.conf. This normally says



    hosts:      files dns


    which means that the resolver library first looks in /etc/hosts and, if it cannot find it there, will use DNS.



    Now DNS will query a DNS server. Which one is determined by /etc/resolv.conf. In addition, there are a number of additional parameters that you can use to help the DNS reolution, of which search (Try this domain first for the host) is probably the most used.






    share|improve this answer




























      1














      resolv.conf is part of the standard way to resolve a host name to an IP address. It is part of the resolver library.



      There are different ways to resolve your host name:




      • files (specifically: /etc/hosts)

      • dns

      • NIS, NIS+ or yp


      The sequence in which they are used is in /etc/nsswitch.conf. This normally says



      hosts:      files dns


      which means that the resolver library first looks in /etc/hosts and, if it cannot find it there, will use DNS.



      Now DNS will query a DNS server. Which one is determined by /etc/resolv.conf. In addition, there are a number of additional parameters that you can use to help the DNS reolution, of which search (Try this domain first for the host) is probably the most used.






      share|improve this answer


























        1












        1








        1







        resolv.conf is part of the standard way to resolve a host name to an IP address. It is part of the resolver library.



        There are different ways to resolve your host name:




        • files (specifically: /etc/hosts)

        • dns

        • NIS, NIS+ or yp


        The sequence in which they are used is in /etc/nsswitch.conf. This normally says



        hosts:      files dns


        which means that the resolver library first looks in /etc/hosts and, if it cannot find it there, will use DNS.



        Now DNS will query a DNS server. Which one is determined by /etc/resolv.conf. In addition, there are a number of additional parameters that you can use to help the DNS reolution, of which search (Try this domain first for the host) is probably the most used.






        share|improve this answer













        resolv.conf is part of the standard way to resolve a host name to an IP address. It is part of the resolver library.



        There are different ways to resolve your host name:




        • files (specifically: /etc/hosts)

        • dns

        • NIS, NIS+ or yp


        The sequence in which they are used is in /etc/nsswitch.conf. This normally says



        hosts:      files dns


        which means that the resolver library first looks in /etc/hosts and, if it cannot find it there, will use DNS.



        Now DNS will query a DNS server. Which one is determined by /etc/resolv.conf. In addition, there are a number of additional parameters that you can use to help the DNS reolution, of which search (Try this domain first for the host) is probably the most used.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 11 at 18:06









        Ljm DullaartLjm Dullaart

        65429




        65429






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f499993%2fhow-shall-i-understand-the-format-of-etc-resolv-conf%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to change which sound is reproduced for terminal bell?

            Can I use Tabulator js library in my java Spring + Thymeleaf project?

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents