Diagnostic -> DNS Lookup 127.0.0.1 always 0?



  • Hi guys.

    Just wondering why in the section Diagnostic-> DNS Lookup any query I run, the loopback interface (127.0.0.1) always show 0 and the other dns's give us numbers even if we run the same query?

    It means that pfsense won't use that interface here and just use the dns we have in the general settings?

    Thanks for your support team.


  • Rebel Alliance Developer Netgate

    It doesn't always show 0. For example, one I just tested shows 43msec to localhost for the first time I asked it for an address. If I make the same request again, then it shows 0.

    It's 0 the second time because the answer was already in its local cache -- it's that fast.

    A 0 doesn't prevent it from being used. That's just a speed measurement.

    If you state the actual problem you're chasing, it's more likely to result in a solution.



  • Jimp is right, but I have seen in my case some queries which I know for sure are not cached, yet I still get 0ms. I think it could be a bug, but it's not really that big of a deal.

    For example, when I just tested this, query to "hemmingway.com" came up with 59ms query time. That makes sense. A second query showed 0ms. That also makes sense due to it being cached from the first query. However, any other query after that will show me 0ms no matter what. With fairly high certainty, I can assume "somerandomsite.com" has not be queried before and is not cached yet it showed me 0ms from 127.0.0.1. I have never understood this and kind of just ignore it at this point. I get the same even if I open a incognito window to ensure that value of 0ms is not cached.

    Raffi


  • LAYER 8 Global Moderator

    There could be some oddness in the how the gui displays that? Best to do from cmd line on pfsense... Just flush your cache to be sure and then lookup something..

    example..

    [2.4.4-RELEASE][admin@sg4860.local.lan]/root: dig www.cnn.com
    
    ; <<>> DiG 9.12.2-P1 <<>> www.cnn.com
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35371
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 4096
    ;; QUESTION SECTION:
    ;www.cnn.com.                   IN      A
    
    ;; ANSWER SECTION:
    www.cnn.com.            3600    IN      CNAME   turner-tls.map.fastly.net.
    turner-tls.map.fastly.net. 3600 IN      A       151.101.185.67
    
    ;; Query time: 190 msec
    ;; SERVER: 127.0.0.1#53(127.0.0.1)
    ;; WHEN: Mon Feb 10 11:18:26 CST 2020
    ;; MSG SIZE  rcvd: 95
    


  • @Raffi_ u got my point.

    Maybe a bug, I see the same behavior.

    This is a test lab, I know that some queries are not in the cache and I get 0 ms in my loopback, is a fresh installation.

    Is not a big deal, just took my attention.

    I'm working on a manual and just want to get clear here.

    U are right Jimp, the dns is working no problem here.

    I can leave with this detail as long the queries flow.

    Thanks all for your knowledge.



  • @johnpoz said in Diagnostic -> DNS Lookup 127.0.0.1 always 0?:

    There could be some oddness in the how the gui displays that? Best to do from cmd line on pfsense... Just flush your cache to be sure and then lookup something..

    example..

    [2.4.4-RELEASE][admin@sg4860.local.lan]/root: dig www.cnn.com
    
    ; <<>> DiG 9.12.2-P1 <<>> www.cnn.com
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35371
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 4096
    ;; QUESTION SECTION:
    ;www.cnn.com.                   IN      A
    
    ;; ANSWER SECTION:
    www.cnn.com.            3600    IN      CNAME   turner-tls.map.fastly.net.
    turner-tls.map.fastly.net. 3600 IN      A       151.101.185.67
    
    ;; Query time: 190 msec
    ;; SERVER: 127.0.0.1#53(127.0.0.1)
    ;; WHEN: Mon Feb 10 11:18:26 CST 2020
    ;; MSG SIZE  rcvd: 95
    

    @johnpoz thanks for the tip. Yes, it works just fine from CLI even without clearing the cache. New queries give different times as expected on the first attempt.


Log in to reply