0

I have a server that is hosted by my university. I have root access, but no control over network setup, firewall, etc. This server's DNS resolves to an internal IP here on campus (10.x.x.x), and an external IP outside campus.

I also have a few servers hosted at Amazon, and they mostly work well. However, one of them started to resolve the university server by its internal IP address. This causes problems, as 10.x.x.x on Amazon EC2 is someone else.

I have connected to the Amazon server with SSH agent forwarding a few times in the past, to access a Git repository on the university server.

Any idea what could cause this?

EDIT: Here's my /etc/resolv.conf

# Generated by dhcpcd for interface eth0
search ec2.internal
nameserver 172.16.0.23

Here's the output of dig myserver.myuniversity.ca.:

; <<>> DiG 9.8.1-P1 <<>> myserver.myuniversity.ca.
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 34470
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;myserver.myuniversity.ca.  IN  A

;; ANSWER SECTION:
myserver.myuniversity.ca. 537586 IN A   10.43.x.x

;; Query time: 2 msec
;; SERVER: 172.16.0.23#53(172.16.0.23)
;; WHEN: Wed Nov 28 16:07:21 2012
;; MSG SIZE  rcvd: 60

Here's the expected output (on another Amazon server):

; <<>> DiG 9.8.1-P1 <<>> myserver.myuniversity.ca.
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8045
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;myserver.myuniversity.ca.  IN  A

;; ANSWER SECTION:
myserver.myuniversity.ca. 601733 IN A   x.x.239.1

;; Query time: 1 msec
;; SERVER: 172.16.0.23#53(172.16.0.23)
;; WHEN: Wed Nov 28 16:09:36 2012
;; MSG SIZE  rcvd: 60
  • Are you using the FQDN in all cases? That'd be my first thought - not using the FQDN + domain suffixing on your connection. – HopelessN00b Nov 28 '12 at 15:39
  • What does the content of the `/etc/resolv.conf` file looks like on that server? – Alex Nov 28 '12 at 15:39
  • That's what I thought at first, but I didn't touch it: # Generated by dhcpcd for interface eth0 search ec2.internal nameserver 172.16.0.23 – emilecantin Nov 28 '12 at 15:48
  • I can't seem to format my previous comment... – emilecantin Nov 28 '12 at 15:50
  • Yeah, [tag:markdown-ate-your-baby]. Having said that, you should edit the contents of `/etc/resolv.conf` into your answer anyway, where the markdown's a little less... awful. – HopelessN00b Nov 28 '12 at 16:03
  • I do not understand the downvotes. THe question seems perfectly sensible. Upvoted. – bortzmeyer Nov 28 '12 at 20:18
  • It is not clear if the resolv.conf you posted is for the "correct" Amazon machine or the "bad" one. Both digs show they used the resolver 172.16.0.23. Is it true? What is this machine, something provided by Amazon? – bortzmeyer Nov 28 '12 at 20:21

1 Answers1

-1

You can fix the IP address of your university server inside Amazon servers by changing /etc/hosts. Windows has the same file as i remember It's a simple solution because it's not clear what's DNS Server of your DOMAIN

Mehdi
  • 80
  • 1
  • 6