Strange DNS behavior

Discussion in 'Installation/Configuration' started by Poliman, May 14, 2018.

  1. Poliman

    Poliman Member

    I have created dns zone under ISP using creator. My server has two public IP, let's say X.X.X.X and Y.Y.Y.Y. In dns zone I use X.X.X.X but in registrar panel I still have Y.Y.Y.Y and website under this specific domain works well and shows (in nslookup) IP Y.Y.Y.Y not this one specified in dns zone. I don't understand this behavior. Is it normal? I thought website should not work, because dns zone contains another IP (but this IP still belong to this same server).
     
  2. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    apache usually listens on all address, so if any dns lookup for the domain name returns an ip for that server, whether that's x.x.x.x or y.y.y.y then it'll display the website unless apache/nginx only listens on one of x.x.x.x or y.y.y.y and not to both of them.
    in ispconfig itself, you can configure each website to use * for the ip4 or ip6 addresses, ( I believe * is the default option) which means the site is configured to display regardless of the ip you connect to, or you can configure it to use a specific ip address, in which case it will only display the website if the connection is made to that address.
    if you specify x.x.x.x for example.com, and dns points to x.x.x.x, then the website will display, if you specify x.x.x.x for the website, and dns points to y.y.y.y, the webserver will display the default page/site instead.
     
  3. Poliman

    Poliman Member

    Yes, ISP has by default * in Website settings -> IPv4.
    But how web browser knows that specific website should point to specific server? In my case I have * for IPv4 for specific website, dns zone and registrar like above I post and after enter website in browser I see address which is not configured in dns zone for this website. It looks like we have three cases:
    1.
    2.
    3. I have * in IP website settings, dns zone points to X.X.X.X, registrar to Y.Y.Y.Y and browser complains website domain uses Y.Y.Y.Y as IP.
     
  4. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    ok, so it's not the webserver that's an issue, it's the dns.
    what dns servers are registered as SOA for the problem domain?
    what ip addresses do those servers have?
    what is the ip of the dns server(s) ispconfig uses?
    what 'A' records did you configure for the domain, and what are their TTL's?
    when did you change the ip's on those 'A' records?


    if nslookup is returning ip y.y.y.y when 'A' record is configured x.x.x.x, either the domain is using a different server for dns than you currently expect, the dns changes haven't propagated, or the dns zone is either not updating properly, or bind is ignoring the changes due to a problem with the zone file
     
  5. Poliman

    Poliman Member

    Generally speaking I thought if server has two public IP it does not matter which one ip address I set in registrar panel if both lead to this same server. Nslookup returns this same IP which I set in registrar but in dns zone on my server (ip set in registrar points to my server where is dns zone for specific domain) I have set secondary IP of my server.
     
  6. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    generally, if you can connect to the server on either ip then there shouldn't be any problems, at least unless the site/port/application is bound to a specific ip.
    browsers are getting smarter though, it may just be that it realises the source ip of the packets it's receiving are not the from the expected ip and it's warning you of a possible 'man in the middle' style attack.

    this is the part that concerns me though, what exactly do you mean by registrar panel?
    nslookup should be returning the ip specified in the dns zone, x.x.x.x, not y.y.y.y which is why I believe there's something wrong either with the dns zone file, or the registered nameservers for that domain.
     
  7. Poliman

    Poliman Member

    Ok, got it. There is asterisk in IPv4 config in ISP. I don't use binding to specific IP. ;)
    I mean that I have to log in OVH client panel and there I can change dns servers of each specific domain. Domain, about which we talk, has there two dns servers, which are mine and also point to my server, where this domain has dns zone. :)
    I am really confused how it's working. :D
     
  8. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    ok. are both the dns servers using ispconfig? is one a secondary server or a mirror of the other?
    what is the domain name that's causing the problems? and what are the actual ip's for x.x.x.x and y.y.y.y?
     
  9. Poliman

    Poliman Member

    Both. They are separate. Domain http://tradzikwymagaczasu.bioderma.pl/. IPs - 54.38.202.128 (secondary) and 145.239.29.218 (main). In dns zone is set secondary ip but nslookup response main ip.
     
  10. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    ok, yep, site seems fine, not seeing any complaints in a browser about it expecting a different ip.
    can't see what the configured dns servers are, whois doesn't return any useful info.
    nslookup tradzikwymagaczasu.bioderma.pl returns the ip 145.239.29.218
    nslookup tradzikwymagaczasu.bioderma.pl 145.239.29.218 returns the ip 54.38.202.128
    as does nslookup against 54.38.202.128.

    it looks like the dns servers are ns6.poliman.net (193.70.38.6) and ns7.poliman.net (54.38.202.128)
    nslookup directly against your dns servers returns the secondary ip, which is what you say is in the dns zone. so that's fine.
    nslookup against other dns servers returns the main ip, which you say isn't in the zone file, that isn't fine.
    considering you initially posted on Monday morning, those records should have replicated out by now.
     
  11. Poliman

    Poliman Member

    Nice answer. Appreciate your help. Could you tell me exactly what commands did you use to provide above informations?
    Could you check derm-in.pl? I would know each site has this problem:
    Above quoted line mention about which other dns servers and they return main IP - 145.239.29.218?

    And what means:
     
  12. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    at it's simplest: any changes you make in your dns zone file have an TTL, which specifies the number of seconds that the record is valid for.
    another dns server queries your server for the root A record for one of your domains, and updates it's own cache of addresses, so it doesn't have to re-query your dns server every time it's asked for that record. once the specified number of seconds since it's query has passed, the cached record expires, if it gets asked for that record again, it doesn't respond with the cached ip address, it requeries your dns server again, and caches the response again.

    nslookup <domainname> queries your computers default dns server for the ip for that domain,
    nslookup <domainname> <ns server name/ip> queries the specified dns server for the ip for that domain.
    you can also use options like nslookup -q=ns <domainname> will query for the registered nameservers for the domainname.

    nslookup derm-in.pl
    Server: 8.8.8.8 <-dns server queried, this is one of google's.
    Address: 8.8.8.8#53
    Non-authoritative answer:
    Name: derm-in.pl
    Address: 54.38.202.128 <- ip address for the domain according to google

    nslookup -q=ns derm-in.pl <- query for registered name servers for the domain
    Server: 8.8.8.8
    Address: 8.8.8.8#53
    Non-authoritative answer:
    derm-in.pl nameserver = ns7.poliman.net. <- name servers according to google
    derm-in.pl nameserver = ns6.poliman.net. <-

    nslookup derm-in.pl ns6.poliman.net <- query your own dns server
    Server: ns6.poliman.net
    Address: 193.70.38.6#53
    Name: derm-in.pl
    Address: 54.38.202.128

    nslookup -q=ns derm-in.pl ns6.poliman.net
    Server: ns6.poliman.net
    Address: 193.70.38.6#53
    derm-in.pl nameserver = ns7.poliman.net.
    derm-in.pl nameserver = ns6.poliman.net.

    they all match up, all looks ok to me.

    for your tradzikymagaczasu.bioderma.pl, I get the same results from queries against both google and from Tethys.ringofsaturn.com
    neither of which match the results I get from querying your own dns servers.

    nslookup tradzikwymagaczasu.bioderma.pl
    Server: 8.8.8.8
    Address: 8.8.8.8#53
    Non-authoritative answer:
    Name: tradzikwymagaczasu.bioderma.pl
    Address: 145.239.29.218

    nslookup -q=ns tradzikwymagaczasu.bioderma.pl
    Server: 8.8.8.8
    Address: 8.8.8.8#53
    Non-authoritative answer:
    tradzikwymagaczasu.bioderma.pl nameserver = ns4.perf1.de.
    tradzikwymagaczasu.bioderma.pl nameserver = ns1.perf1.com.
    tradzikwymagaczasu.bioderma.pl nameserver = ns5.perf1.asia.
    tradzikwymagaczasu.bioderma.pl nameserver = ns3.perf1.eu.
    tradzikwymagaczasu.bioderma.pl nameserver = ns2.perf1.fr.
    Authoritative answers can be found from:

    nslookup tradzikwymagaczasu.bioderma.pl ns6.poliman.net
    Server: ns6.poliman.net
    Address: 193.70.38.6#53
    Name: tradzikwymagaczasu.bioderma.pl
    Address: 54.38.202.128

    nslookup -q=ns tradzikwymagaczasu.bioderma.pl ns6.poliman.net
    Server: ns6.poliman.net
    Address: 193.70.38.6#53
    tradzikwymagaczasu.bioderma.pl nameserver = ns7.poliman.net.
    tradzikwymagaczasu.bioderma.pl nameserver = ns6.poliman.net.
     
    Poliman likes this.
  13. Poliman

    Poliman Member

    Thank you for detailed answer. I see the difference between registered nameservers and my computer dns servers and specified dns server for domain tradzikwymagaczasu.bioderma.pl.
     

Share This Page